%I #16 Sep 30 2020 03:29:21
%S 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,
%T 37,38,40,41,42,44,46,47,48,51,52,53,54,58,59,60,64,65,66,67,68,70,71,
%U 72,74,76,77,78,81,82,83,84,88,89,90,96,97,98,100,101,102
%N 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.
%C Former name: Addition of lowest nonzero prime division remainders.
%C 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.
%H Amiram Eldar, <a href="/A146215/b146215.txt">Table of n, a(n) for n = 1..10000</a>
%t 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 *)
%o (MATLAB) % prime is expected to be an array containing all required primes.
%o 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
%K easy,nonn
%O 1,2
%A Sigurd Wenner (sigurd.wenner(AT)ils.uio.no), Oct 28 2008
%E Corrected and extended by _Harvey P. Dale_, Jul 19 2013