Sum of primes in odd positions is prime: Difference between revisions
Sum of primes in odd positions is prime (view source)
Revision as of 20:45, 31 January 2023
, 1 year ago→{{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.
1 2 2
3 5 7
|