[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A146215
a(1) = 1, a(n+1) = a(n) + mod(a(n), p), where p is the lowest prime such that mod(a(n), p) is nonzero.
1
1, 2, 4, 5, 6, 7, 8, 10, 11, 12, 14, 16, 17, 18, 21, 22, 23, 24, 28, 29, 30, 32, 34, 35, 36, 37, 38, 40, 41, 42, 44, 46, 47, 48, 51, 52, 53, 54, 58, 59, 60, 64, 65, 66, 67, 68, 70, 71, 72, 74, 76, 77, 78, 81, 82, 83, 84, 88, 89, 90, 96, 97, 98, 100, 101, 102
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
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
Sequence in context: A249031 A085302 A193928 * A086743 A285432 A039079
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