login
A114898
a(1)=0. a(n) = number of earlier terms a(k) (1 <=k <=n-1) where a(k)+n is a prime.
3
0, 1, 1, 2, 2, 2, 1, 0, 3, 4, 5, 4, 4, 2, 7, 5, 6, 5, 5, 1, 4, 5, 3, 6, 6, 7, 8, 6, 7, 7, 6, 5, 5, 6, 11, 16, 13, 9, 9, 11, 12, 13, 7, 4, 6, 11, 10, 12, 8, 7, 8, 12, 12, 15, 17, 14, 12, 11, 15, 16, 15, 14, 11, 13, 16, 21, 22, 18, 12, 11, 16, 17, 14, 12, 12, 12, 20, 17, 10, 8, 14, 14, 16, 13, 21
OFFSET
1,4
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 9 terms of the sequence, we get [10,11,11,12,12,12,11,10,13]. Of these only the three 11's and the 13 are primes. So a(10) = 4.
MATHEMATICA
Fold[Append[#1, Count[#1 + #2, _?PrimeQ]] &, {0}, Range[2, 85]] (* Michael De Vlieger, Sep 28 2017 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Jan 05 2006
EXTENSIONS
Corrected and extended by T. D. Noe, Apr 30 2007
STATUS
approved