login
Those n for which the absolute value of A059876[n] is prime.
3

%I #6 Mar 07 2016 02:58:40

%S 1,3,4,5,6,10,11,12,13,15,16,17,18,21,22,24,26,27,28,30,32,33,34,38,

%T 39,40,41,42,45,46,48,50,51,52,54,55,56,57,59,60,63,64,67,68,69,70,72,

%U 74,75,76,78,79,80,81,83,84,85,87,89,93,94,96,98,102,103,104,105,109,111

%N Those n for which the absolute value of A059876[n] is prime.

%C Of the first 511 terms of A059876, 278 are primes.

%p positions(true,map(isprime,map(abs, A059876))); # positions function given in A059649.

%t a[n_] := With[{s = Floor[Log[2, n]]}, (-1)^(n+1) + Sum[(-1)^(Floor[n/2^i] + 1)*Prime[i], {i, 1, s}] + If[1 == n, 1, Mod[s + 1, 2]*Prime[s]]];

%t A059877 = Position[Array[a, 120], p_ /; PrimeQ[Abs[p]]] // Flatten (* _Jean-François Alcover_, Mar 07 2016 *)

%Y Cf. A059879.

%K nonn

%O 1,2

%A _Antti Karttunen_, Feb 05 2001