login
A114899
a(1)=0. a(n+1) = number of earlier terms a(k) (1 <=k <=n) where a(k)+n is a prime.
3
0, 0, 2, 3, 1, 3, 1, 2, 2, 3, 5, 5, 4, 3, 6, 4, 6, 7, 4, 5, 4, 3, 3, 4, 4, 8, 9, 9, 10, 6, 3, 6, 5, 8, 10, 9, 7, 14, 14, 13, 12, 10, 6, 11, 10, 7, 6, 11, 7, 11, 13, 9, 10, 12, 10, 14, 14, 19, 15, 13, 13, 16, 11, 15, 18, 16, 14, 18, 17, 20, 18, 12, 11, 16, 10, 13, 16, 13, 12, 18, 12, 10, 9, 18
OFFSET
1,3
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000 (first 2000 terms from T. D. Noe)
EXAMPLE
If we add 10 to each of the first 10 terms of the sequence, we get [10,10,12,13,11,13,11,12,12,13]. Of these only the two 11's and the three 13's are primes. So a(11) = 5.
MATHEMATICA
Fold[Append[#1, Count[#1 + #2 - 1, _?PrimeQ]] &, {0}, Range[2, 84]] (* Michael De Vlieger, Sep 28 2017 *)
PROG
(PARI) seq=vector(200); print1(0, ", "); for(j=1, 190, count=0; for(k=0, j-1, if(isprime(j+seq[k+1])==1, count=count+1; )); seq[j+1]=count; print1(seq[j+1], ", ")) \\ Matthew Conroy, Feb 09 2006
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Jan 05 2006
EXTENSIONS
More terms from Matthew Conroy, Feb 09 2006
STATUS
approved