A320672 a(n) is the smallest divisor of (n+2)*(n+3) not yet in the sequence.
1, 2, 4, 3, 6, 7, 8, 5, 10, 11, 12, 13, 14, 15, 16, 9, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 17, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 33, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 44, 56, 57, 58, 59, 60, 61, 62, 63, 64, 55, 66, 67, 68, 69, 70
Offset: 0
Keywords
Examples
For n = 0, a(0) = 1 since 1 is the smallest divisor of 6 not yet in the sequence. For n = 3, a(3) = 3 since 3 is the smallest divisor of 30 not yet in the sequence.
Programs
-
Mathematica
s = {}; Do[d = Divisors[(n + 2)(n + 3)]; Do[d1 = d[[k]]; If[FreeQ[s, d1], AppendTo[s, d1]; Break[]], {k, Length[d]}], {n, 0, 100}]; s (* Amiram Eldar, Nov 14 2018 *)
-
PARI
toadd(n, v) = {fordiv(n, d, if (!vecsearch(v, d), return(d)); ); } lista(nn) = {v = []; for (n = 0, nn, newt = toadd((n+2)*(n+3), v); print1(newt, ", "); v = vecsort(concat(v, newt)); ); } \\ Michel Marcus, Nov 20 2018
Comments