All prime numbers from 1 to 50 with alternating sign
Answers
Answer:
Here is a new method to calculate the sum of all prime numbers between 1 and n. I’ve also wrote a program to calculate this, if you are interested.
How to find the sum of primes between 1 and n
There is a new way to find the sum of primes between 1 and n. Suppose one is required to find the sum of primes between 1 and 50, n = 50.
First, find the absolute value of (n / 6): z = abs(n / 6), since n = 50, the value is z = 8.
There are 2 ways to find prime numbers: 6x + 1 and 6x + 5. Using z = 8, the last primes for n = 50 is; let x = z: 6x + 1 = 49, and 6x + 5 = 53.
One now must use the twin prime theory to solve the summation, using the equations: 6x + 1, and 6(x-1) + 5. One can see that 6(x-1) + 5 when x = 8, is now 47, which is lower than n = 50.
x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
6x + 1
7
13
19
25
31
37
43
49
55
61
67
73
79
85
91
97
103
109
115
121
6y + 5
5
11
17
23
29
35
41
47
53
59
65
71
77
83
89
95
101
107
113
119
12x
12
24
36
48
60
72
84
96
108
120
132
144
156
168
180
192
204
216
228
240
There is an equation for twin primes: 2m + 1 and 2m – 1.
Viewing x = 1, one can see that 6x + 1 = 2m + 1. Solving this equation, 6x = 2m. Therefore, using 6x + 1, and 6y + 5 (y = x – 1) are true for finding twin primes.
When adding 6x + 1 and 6y + 5, one gets the value of 12x. (6x + 1) + (6[x-1] + 5) = v.
6x + 1 + 6x – 6 +5 = v. v = 12x.
Therefore, using z =8, the first summation s = [12(z) + 12(1)] * (z / 2) = 432.
Now one must subtract the pseudoprimes. The original value for z is z = 8. The highest prime number below z = 8 is 7. One can use that value as the highest prime value to find and subtract the pseudoprimes when n = 50. The lowest prime number is 5.
So, 5 * 5 = 25, 5 * 7 = 35, 7 * 7 = 49. Adding these values up, p = 109.
Now the value s = s – p: s = 432 – 109 = 323
The next step is add 2 + 3, which are the lowest primes, to the value s.
s = s + 5 = 323 + 5 = 328.
Therefore the summation of primes between 1 and 50 is 328.
These sets of equations can be used to find the summation of primes between 1 and any value of n, as long as the value of z = even number. There are different rules for z = odd number.
What are the prime numbers between 1 and 50?
What is the sum of all the prime numbers between 1 and 25?
What is the sum of prime numbers from 1 to 100 formula?
What is the sum of first 50 prime numbers?
What is the sum of all prime numbers between 50 and 90?
There is no formula which generates primes.
All the primes less than 50 are:
2,3,5,7,11,13,17,19,23,29,31,37,41,47
hence required sum is 2+3+5+7+11+13+17+19+23+29+31+37+41+47
=17 + 24 + 36 + 52 + 68 + 88
=41 +88 +156 = 285.