OFFSET
1,4
LINKS
T. D. Noe, Table of n, a(n) for n = 1..2000
EXAMPLE
Among the first 10 terms, a(3) + 11, a(4) + 11, a(5) + 11, a(6) + 11 and a(8) + 11 are primes. So a(11) = 5.
If we add 10 to each of the first 9 terms of the sequence, we get [11,11,10,12,12, 12,11,10,13]. Of these, only the three 11's and the 13 are primes. So a(10) = 4.
MAPLE
A108839 := proc(nmax) local a, nxt, k ; n := 2 ; a := [1] ; while n < nmax do nxt := 0 ; for k from 1 to n-1 do if isprime(op(k, a)+n) then nxt := nxt+1 ; fi ; od ; a := [op(a), nxt] ; n := n+1 ; od ; a ; end: A108839(80) ; # R. J. Mathar, Aug 11 2008
MATHEMATICA
t={1}; Do[AppendTo[t, Length[Select[t+n, PrimeQ]]], {n, 2, 2000}]; t (* T. D. Noe *)
PROG
(PARI) {m=85; v=[1]; for(n=2, m, c=0; for(j=1, length(v), if(isprime(v[j]+n), c++)); v=concat(v, c)); for(j=1, m, print1(v[j], ", "))} - Klaus Brockhaus, Aug 04 2005
(Haskell)
a108839 n = a108839_list !! (n-1)
a108839_list = 1 : f 2 [1] where
f x zs = z : f (x + 1) (z : zs) where
z = toInteger $ sum $ map (a010051 . (+ x)) zs
-- Reinhard Zumkeller, Jul 31 2012
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Jul 30 2005
EXTENSIONS
More terms and PARI code from Klaus Brockhaus, Aug 04 2005
Edited by R. J. Mathar, Aug 11 2008
STATUS
approved