OFFSET
1,2
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
The primes <= 8 are 2,3,5,7. Of these, only 3 and 7 don't divide a(7)=40. So a(8) = a(7) + 3 + 7 = 50.
MAPLE
A137395 := proc(n) option remember ; local aprev, i, a, p; if n = 1 then RETURN(1) ; fi; aprev := A137395(n-1) ; a := aprev ; for i from 1 do p := ithprime(i) ; if p > n then break; fi ; if aprev mod p <> 0 then a := a+p ; fi ; od: a ; end: seq(A137395(n), n=1..100) ; # R. J. Mathar, May 23 2008
MATHEMATICA
nxt[{n_, a_}]:=Module[{dpdd=Total[Select[Prime[Range[PrimePi[n+1]]], !Divisible[ a, #]&]]}, {n+1, a+dpdd}]; NestList[nxt, {1, 1}, 50][[All, 2]] (* Harvey P. Dale, Apr 28 2018 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Apr 10 2008
EXTENSIONS
More terms from R. J. Mathar, May 23 2008
STATUS
approved