[go: up one dir, main page]

login
A123541
a(0) = 2; for n > 0, a(n) = number of earlier terms which when added to n give a prime.
5
2, 1, 1, 1, 3, 1, 4, 1, 1, 2, 7, 2, 7, 1, 1, 4, 11, 3, 9, 2, 4, 4, 11, 0, 2, 4, 4, 11, 11, 6, 14, 2, 5, 7, 6, 8, 16, 10, 4, 15, 13, 9, 13, 10, 5, 9, 14, 5, 9, 9, 11, 10, 17, 6, 9, 11, 13, 19, 20, 11, 22, 8, 17, 14, 13, 14, 20, 13, 13, 22, 23, 9, 20, 8, 12, 16, 11, 13, 21, 13, 13, 16, 14, 12, 16, 15
OFFSET
0,1
FORMULA
a(n) = A114897(n+1) for n>2. - T. D. Noe, Apr 30 2007
MAPLE
M:=100; a:=array(0..M); a[0]:=2; for n from 1 to M do t1:=0; for i from 0 to n-1 do if isprime(n+a[i]) then t1:=t1+1; fi; od: a[n]:=t1; od: [seq(a[n], n=0..M)];
MATHEMATICA
t={2}; Do[AppendTo[t, Length[Select[t+n, PrimeQ]]], {n, 2000}]; t (* T. D. Noe, Apr 30 2007 *)
CROSSREFS
Sequence in context: A060247 A060246 A161204 * A345062 A324537 A090379
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, based on email from Zak Seidov, Oct 16 2006
STATUS
approved