A181054 Numbers n such that Sum_{k=1..n} (-1)^(n-k)*sigma(k) is prime.
2, 3, 4, 6, 10, 22, 24, 32, 64, 66, 68, 92, 102, 112, 134, 168, 240, 262, 264, 270, 274, 316, 396, 442, 448, 538, 540, 542, 554, 560, 562, 582, 608, 612, 650, 652, 654, 668, 672, 786, 788, 866, 880, 924, 938, 940, 942, 948, 984, 988, 1008, 1018, 1064, 1074
Offset: 1
Keywords
Examples
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.
Programs
-
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:
-
PARI
isok(n) = isprime(sum(k=1, n, (-1)^(n-k)*sigma(k))); \\ Michel Marcus, Oct 04 2017
Comments