A111267 Let q(n) = prime(1) + ... + prime(n); a(n) = smallest divisor of q(n) not already in sequence.
1, 5, 2, 17, 4, 41, 29, 7, 10, 3, 8, 197, 14, 281, 82, 127, 11, 167, 71, 9, 89, 113, 19, 107, 20, 27, 16, 457, 37, 59, 40, 617, 28, 709, 569, 809, 34, 67, 31, 21, 23, 383, 214, 1277, 38, 1409, 317, 79, 13, 43, 25, 69, 22, 2027, 3169, 161, 6, 193, 3709, 7699, 26, 331, 613, 8893
Offset: 1
Keywords
Links
- Donovan Johnson, Table of n, a(n) for n = 1..10000
Programs
-
Maple
with(numtheory); M:=500; p0:=2; a[1]:=1; for n from 2 to M do p0:=p0+ithprime(n); t1:=divisors(p0); t2:=nops(t1); for i from 1 to t2 do d:=t1[i]; hit:=0; for j from 1 to n-1 do if a[j]=d then hit:=1; break; fi; od: if hit = 0 then a[n]:=d; break; fi; od: od: s1:=[seq(a[n],n=1..M)];
-
Mathematica
Fold[Function[{l, d}, Append[l, SelectFirst[d, FreeQ[l, #] &]]], {}, Divisors@Accumulate@Prime@Range[100]] (* Virgile Andreani, Jul 11 2016 *)
Comments