# Cumulative Sum and Indexing Formulae

## Used in Conjunction with Prime Spiral Sieve Algorithms

This work is licensed by its author, Gary William Croft, under a

"This sieve is the source of two efficient prime number factorization algorithms and completely deconstructs the twin prime sequence." – Philip Gervasse Jackson, citing the Prime Spiral Sieve in Simplicity Instinct: Why Prime Numbers are Elusive!

## The Four Cumulative Sum Formulae:

While rolling stones may gather no moss, the same can't be said when it comes to 'rolling up' numbers. These formulae expose the fact that natural numbers have many hidden dimensions and what we like to think of as 'weights.' These analytical tools are especially powerful when aggregated.

1. Cumulative Sums (k) for Natural Numbers (n) 1, 2, 3, ...

k = (n + n2)/2.

Examples:

n = 89:   k = (89 + 892)/2 = 4,005.
n = 7919: k = (7919 + 79192)/2 = 31,359,240,

2. Cumulative Digital Root (dr) Sums (k) for Natural Numbers 1, 2, 3, ... (parsed by digital roots 1-9)

For dr = 1: k = 5n−4; (e.g., n = 37; k = 5 * 37−4 = 181).
For dr = 2: k = 5n−7; (e.g., n = 29; k = 5 * 29−7 = 138).
For dr = 3: k = 5n−9; (e.g., n = 30; k = 5 * 30−9 = 141).
For dr = 4: k = 5n−10; (e.g., n = 67; k = 5 * 67−10 = 325).
For dr = 5: k = 5n−10; (e.g., n = 23; k = 5 * 23−10 = 105).
For dr = 6: k = 5n−9; (e.g., n = 24; k = 5 * 24−9 = 111).
For dr = 7: k = 5n−7; (e.g., n = 16; k = 5 * 16−7 = 73).
For dr = 8: k = 5n−4; (e.g., n = 17; k = 5 * 17−4 = 81).
For dr = 9: k = 5n−0; (e.g., n = 72; k = 5 * 72−0 = 360.

The examples above were taken from the section of spreadsheet cut-and-pasted below covering the range of natural numbers 1 thru 72 (and associated cumulative digital root 1 thru 360). Prime numbers are hi-lited in yellow. Based on this analysis, it can easily be proven that, with the exception of the first prime (1+2=3) all primes in this sequence are congruent to {1 or 73} modulo 90, and therefore all, with the exception of number 3, have digital root 1. For example, in the range 1 thru 7920 there are 345 such 'cumulative digital root' primes (and of these, 171 are n ≡ {1} mod 90 and 173 are n ≡ {73} mod 90. Number 3 is the only outlier).

3. Cumulative Sums (k) for n ≡ {1, 7, 11, 13, 17, 19, 23, 29} Modulo 30 (parsed modulo 30)

Referencing the right-hand (pink) column:

Input = n ≡ {1, 7, 11, 13, 17, 19, 23, 29} Modulo 30;
Output (k) = Cumulative Sum (1 → n): 4. Cumulative Digital Root Sums (k) for n ≡ {1, 7, 11, 13, 17, 19, 23, 29} Modulo 30 (parsed modulo 90) ## The Two Indexing Fomulae:

1. Input = natural numbers 1, 2, 3, ..., i.e., Index #;
Output = n congruent to {1, 7, 11, 13, 17, 19, 23, 29} Modulo 30.

Parsing by modulo 8 congruence allows us to input index numbers and output the numbers not divisible by 2, 3, or 5 the inputs reference. The 8 negative adjustments per cycle form four bilateral pairs summing to 3.75, and 4 * 3.75 = 15. [Note that the ratio of n 1,2,3,... to n not divisible by 2, 3, or 5 converges ascendantly to 30/8 = 3.75. For example 89/24 (24 being 89's index number, and thus the ratio's denominator) = 3.708333... while 7919/2112 (2112 = 7919's index number) = 3.74952651515..., etc. Reverse the ratio and the series converges descendently to 8/30 = .2666...].

n ≡ {1} mod 8: k = n * 30/8 − 2.75 = n ≡  {1}  mod 30
n ≡ {2} mod 8: k = n * 30/8 − 0.50 = n ≡  {7}  mod 30
n ≡ {3} mod 8: k = n * 30/8 − 0.25 = n ≡ {11} mod 30
n ≡ {4} mod 8: k = n * 30/8 − 2.00 = n ≡ {13} mod 30
n ≡ {5} mod 8: k = n * 30/8 − 1.75 = n ≡ {17} mod 30
n ≡ {6} mod 8: k = n * 30/8 − 3.50 = n ≡ {19} mod 30
n ≡ {7} mod 8: k = n * 30/8 − 3.25 = n ≡ {23} mod 30
n ≡ {0} mod 8: k = n * 30/8 − 1.00 = n ≡ {29} mod 30

Here are the first 24 outputs of the stair-stepping formula:

k = 1 * 30/8 − 2.75 = 1
k = 2 * 30/8 − 0.50 = 7
k = 3 * 30/8 − 0.25 = 11
k = 4 * 30/8 − 2.00 = 13

k = 5 * 30/8 − 1.75 = 17
k = 6 * 30/8 − 3.50 = 19
k = 7 * 30/8 − 3.25 = 23
k = 8 * 30/8 − 1.00 = 29

k = 9 * 30/8 − 2.75 = 31
k = 10 * 30/8 − 0.50 = 37
k = 11 * 30/8 − 0.25 = 41
k = 12 * 30/8 − 2.00 = 43

k = 13 * 30/8 − 1.75 = 47
k = 14 * 30/8 − 3.50 = 49
k = 15 * 30/8 − 3.25 = 53
k = 16 * 30/8 − 1.00 = 59

k = 17 * 30/8 − 2.75 = 61
k = 18 * 30/8 − 0.50 = 67
k = 19 * 30/8 − 0.25 = 71
k = 20 * 30/8 − 2.00 = 73

k = 21 * 30/8 − 1.75 = 77
k = 22 * 30/8 − 3.50 = 79
k = 23 * 30/8 − 3.25 = 83
k = 24 * 30/8 − 1.00 = 89

2. Input = n ≡ {1, 7, 11, 13, 17, 19, 23, 29} Modulo 30;
Output = natural numbers 1, 2, 3, ..., i.e., Index # of Input.

For these formulae, reference the left-hand (green) column of the graphic for #3 of the four Cumulative Sum Formulae, above.

## Examples:

Here are several examples employing the above formulae. The roles played by these particular numbers in our 'system of thought' have been discussed at various points throughout this site. We end this section with an interesting way to generate a string of reciprocals for n congruent to {29} modulo 30 employing a few of the above formulae, where:

k = index # for n ≡ {29} modulo 30 as a member of n ≡ {1,7,11,13,17,19,23,29} mod 30 (i.e., n not divisible by 2, 3, or 5).
30/8 = ratio, n 1, 2, 3, ... to n not divisible by 2, 3, or 5.

k/n x 30/8−1 = 1/n (i.e., n's reciprocal).

Examples; Four primes ≡ {29} mod 30:

8/29 x 30/8−1 = 1/29.
16/59 x 30/8−1 = 1/59.
24/89 x 30/8−1 = 1/89.
2112/7919 x 30/8−1 = 1/7919.

The explanation for this becomes evident when we examine the formula for calculating index # (k) of n ≡ {29} mod 30:
k = (n+1) x 8/30.