OFFSET
1,1
COMMENTS
These are the positions of primes in (-1)^(n-1)*A068762(n) = 1, 2, 2, 5, 1, 11, -3, 18, -5, 23, ... [R. J. Mathar, Nov 18 2010]
The first primes generated by the alternating sum are 2, 2, 5, 11, 23, 103, 139, 239, 859, 919, 977, 1811, 2207, 2657, ...
EXAMPLE
4 is in the sequence because Sum_{k=1..4} (-1)^(4-k)*sigma(k) = (-1)^3*1 + (-1)^2*3 + (-1)^1*4 + (-1)^0*7 = -1 + 3 - 4 + 7 = 5 is prime.
MAPLE
with(numtheory): for n from 1 to 2000 do:x:=sum((((-1)^(n-k))*sigma(k), k=1..n)): if type(x, prime)=true then printf(`%d, `, n):else fi:od:
PROG
(PARI) isok(n) = isprime(sum(k=1, n, (-1)^(n-k)*sigma(k))); \\ Michel Marcus, Oct 04 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Oct 01 2010
STATUS
approved