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

m
→‎{{header|J}}: bugfix for generalization: constraint is primes less than 1000, not primes up through 1000
m (→‎{{header|J}}: adjust expression so it would remain correct even if 1000 were replaced with a prime number)
m (→‎{{header|J}}: bugfix for generalization: constraint is primes less than 1000, not primes up through 1000)
Line 359:
=={{header|J}}==
 
<syntaxhighlight lang=J> (i,.p,.sum) #~ 1 p: sum=. +/\p=. p:<:i=. (#~ 2|])i. 21+p:inv 1000
1 2 2
3 5 7
6,962

edits