OFFSET
1,2
COMMENTS
Former name: Addition of lowest nonzero prime division remainders.
The sequence is linear on a large scale. For 10^9 terms, a(n)/n is calculated to be 1.5859351, giving an approximate natural density of 0.6305428.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
MATHEMATICA
lp[n_]:=Module[{t=2}, While[Mod[n, t]==0, t=NextPrime[t]]; t]; NestList[ #+Mod[#, lp[#]]&, 1, 70] (* Harvey P. Dale, Jul 19 2013 *)
PROG
(MATLAB) % prime is expected to be an array containing all required primes.
a = zeros(1, terms); a(1) = 1; for n = 1:terms-1 j = 1; right = 0; while (right == 0) if (mod(a(n), prime(j)) == 0) j = j + 1; else right = 1; end end a(n+1) = a(n) + mod(a(n), prime(j)); end
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Sigurd Wenner (sigurd.wenner(AT)ils.uio.no), Oct 28 2008
EXTENSIONS
Corrected and extended by Harvey P. Dale, Jul 19 2013
STATUS
approved