A094339 Beginning with 2, least number not occurring earlier that divides the sum of all previous terms.
2, 1, 3, 6, 4, 8, 12, 9, 5, 10, 15, 25, 20, 24, 16, 32, 48, 30, 18, 36, 27, 13, 7, 53, 106, 265, 159, 318, 212, 14, 107, 321, 214, 428, 642, 535, 35, 21, 181, 11, 33, 22, 23, 59, 70, 28, 151, 29, 19, 233, 466, 2563, 699, 932, 40, 26, 38, 31, 61, 39, 49, 98, 42, 56, 50, 197, 17
Offset: 1
Keywords
Examples
The sum of first 7 terms is 36, hence a(8) = 9 is the least divisor of 36 not occurring earlier.
Links
- Ivan Neretin, Table of n, a(n) for n = 1..10000
Programs
-
Maple
A094339 := proc(nmax) local a,n,sprev,i; a := [2] ; while nops(a) < nmax do sprev := add(i,i=a) ; n := 1 ; while sprev mod n <> 0 or n in a do n := n+1 ; od ; a := [op(a),n] ; od ; RETURN(a) ; end: A094339(100) ; # R. J. Mathar, Apr 30 2007
-
Mathematica
a={2}; Do[AppendTo[a,Min[Select[Divisors[Plus@@a],!MemberQ[a,#]&]]], {t,2,70}]; a (* Ivan Neretin, Apr 13 2015 *)
-
PARI
v=[2];n=1;while(#v<100,if(!vecsearch(vecsort(v,,8),n)&&!(vecsum(v)%n),v=concat(v,n);n=0);n++);v \\ Derek Orr, Apr 13 2015
Extensions
Corrected and extended by R. J. Mathar, Apr 30 2007
Comments