OFFSET
1,1
COMMENTS
The partial alternating sums of the number of divisors tau(.)=A000005(.) are 1, 1, 1, 2, 0, 4, -2, 6, -3, 7, -5, 11, -9, 13,.. for n>=0.
The first primes generated are 2, 7, 11, 13, 29, 31, 37, 41, 41, 71, 73, 79, 83, 83, 131, 157, 157, 223,... for upper limits of the sum as recorded by the sequence.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
n=4 is in the sequence because sum_{k=1..4} (-1)^(4-k)*tau(k) = (-1)^3*1 + (-1)^2*2 + (-1)^1*2 + (-1)^0*3 = -1 +2 -2 + 3 = 2 is prime.
MAPLE
with(numtheory): for n from 1 to 1000 do: x:=sum((((-1)^(n-k))*tau(k), k=1..n)): if type(x, prime)=true then printf(`%d, `, n): fi: od:
MATHEMATICA
s={}; sum=0; Do[sum = DivisorSigma[0, n] - sum; If[sum > 0 && PrimeQ[sum], AppendTo[s, n]], {n, 1, 654}]; s (* Amiram Eldar, Sep 10 2019 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Oct 01 2010
EXTENSIONS
Comment slightly extended by R. J. Mathar, Oct 24 2010
STATUS
approved