login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A181054 Numbers n such that Sum_{k=1..n} (-1)^(n-k)*sigma(k) is prime. 0

%I #9 Oct 04 2017 02:12:51

%S 2,3,4,6,10,22,24,32,64,66,68,92,102,112,134,168,240,262,264,270,274,

%T 316,396,442,448,538,540,542,554,560,562,582,608,612,650,652,654,668,

%U 672,786,788,866,880,924,938,940,942,948,984,988,1008,1018,1064,1074

%N Numbers n such that Sum_{k=1..n} (-1)^(n-k)*sigma(k) is prime.

%C 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]

%C The first primes generated by the alternating sum are 2, 2, 5, 11, 23, 103, 139, 239, 859, 919, 977, 1811, 2207, 2657, ...

%e 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.

%p 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:

%o (PARI) isok(n) = isprime(sum(k=1, n, (-1)^(n-k)*sigma(k))); \\ _Michel Marcus_, Oct 04 2017

%Y Cf. A000203, A068762.

%K nonn

%O 1,1

%A _Michel Lagneau_, Oct 01 2010

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 10:21 EDT 2024. Contains 371905 sequences. (Running on oeis4.)