Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #11 Sep 10 2019 05:25:28
%S 4,10,12,14,26,28,30,32,34,50,52,54,56,58,82,92,94,124,130,132,134,
%T 136,138,176,178,186,234,240,292,300,302,304,306,308,312,366,372,374,
%U 376,384,390,392,394,398,458,540,548,564,566,570,632,634,638,644,646,654
%N Numbers n such that Sum_{k=1..n} (-1)^(n-k) *tau(k) is prime.
%C 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.
%C 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.
%H Amiram Eldar, <a href="/A181053/b181053.txt">Table of n, a(n) for n = 1..10000</a>
%e 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.
%p 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:
%t 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 *)
%Y Cf. A000005.
%K nonn
%O 1,1
%A _Michel Lagneau_, Oct 01 2010
%E Comment slightly extended by _R. J. Mathar_, Oct 24 2010