A349872 a(1) = 2; for n > 1, a(n) is the smallest unused number > 1 such that none of the previous a(n) terms divide a(n).
2, 3, 5, 7, 11, 4, 13, 17, 6, 19, 23, 9, 29, 10, 8, 31, 37, 41, 14, 15, 43, 12, 47, 53, 59, 21, 61, 22, 25, 67, 18, 16, 71, 26, 20, 73, 79, 83, 33, 27, 35, 89, 34, 97, 101, 103, 24, 28, 38, 39, 30, 107, 109, 49, 113, 127, 131, 46, 137, 51, 55, 139, 149, 151, 32, 45, 157, 36, 42, 57, 163, 58, 44
Offset: 1
Keywords
Links
- Scott R. Shannon, Image of the first 10000 terms. The green line is a(n) = n.
Programs
-
Mathematica
a[1]=2;a[n_]:=a[n]=(k=2;While[MemberQ[s=Array[a,n-1],k]||Or@@(IntegerQ/@(k/s[[-If[k>=n,n-1,k];;]])),k++];k);Array[a,73] (* Giorgos Kalogeropoulos, Dec 03 2021 *)
-
Python
def aupton(terms): alst, aset = [2], {2} for n in range(2, terms+1): k = 2 while k in aset or any(k%j == 0 for j in alst[-k:]): k += 1 alst.append(k); aset.add(k) return alst print(aupton(73)) # Michael S. Branicky, Dec 03 2021
Formula
a(2) = 3 as the previous term 2 does not divide 3.
a(6) = 4 as none of the previous four terms, 3, 5, 7, 11, divide 4.
a(9) = 6 as none of the previous six terms, 5, 7, 11, 4, 13, 17, divide 6.
Comments