Sum of primes in odd positions is prime: Difference between revisions

adjusted task description to fit solutions
m (syntax highlighting fixup automation)
(adjusted task description to fit solutions)
Line 2:
 
;Task:
<br>Let '''p(i)''' be a sequence of prime numbers. such that 2=p(1), 3=p(2), 5=p(3), ...
<br>Consider the '''p(1),p(3),p(5), ... ,p(i)''', for each '''p(i) < 1,000''' and '''i''' is odd.
<br>Let '''sum''' be theany [[wikipedia:Prefix_sum|prefix sum]] of these primesprimesa.
<br>If '''sum''' is prime then print '''i''', '''p(i)''' and '''sum'''.
 
6,962

edits