OFFSET
1,23
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
FORMULA
A007510(a(n)) = n.
MATHEMATICA
upto = 100;
A074038list[upto_] := Module[{k = 0, v = Table[0, {upto}], n},
For[n = 1, n <= upto, n++, If[PrimeQ[n] && (2 == n ||
((!PrimeQ[n-2]) && (!PrimeQ[n+2]))), k++; v[[n]] = k,
v[[n]] = 0]]; v];
v074038 = A074038list[upto];
a[n_] := v074038[[n]];
Table[a[n], {n, 1, upto}] (* Jean-François Alcover, Dec 03 2021, after PARI code *)
PROG
(PARI)
up_to = 65537;
A074038list(up_to) = { my(k=0, v=vector(up_to)); for(n=1, up_to, if(isprime(n)&&(2==n||((!isprime(n-2))&&(!isprime(n+2)))), k++; v[n]=k, v[n] = 0)); (v); };
v074038 = A074038list(up_to);
A074038(n) = v074038[n];
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Aug 13 2002
STATUS
approved