A026416 A 2-way classification of integers: a(1) = 1, a(2) = 2 and for n > 2, a(n) is the smallest number not of the form a(i)*a(j) for 1 <= i < j < n.
1, 2, 3, 4, 5, 7, 9, 11, 13, 16, 17, 19, 23, 24, 25, 29, 30, 31, 37, 40, 41, 42, 43, 47, 49, 53, 54, 56, 59, 61, 66, 67, 70, 71, 73, 78, 79, 81, 83, 88, 89, 97, 101, 102, 103, 104, 105, 107, 109, 110, 113, 114, 121, 127, 128, 130, 131, 135, 136, 137, 138, 139
Offset: 1
Examples
a(8) is not 10 because we already have 10 = 2*5. Of course all primes appear. 16 appears because 16 is not a product of earlier terms.
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000 (terms 1..400 from Vincenzo Librandi)
Crossrefs
Similar sequences with different starting conditions: A026417 (1,3), A026419 (1,4), A026420 (2,4), A026421 (3,4).
Programs
-
Mathematica
a[1]=1; a[2]=2; a[n_] := a[n] = For[k = a[n-1] + 1, True, k++, If[ FreeQ[ Table[ a[i]*a[j], {i, 1, n-2}, {j, i+1, n-1}], k], Return[k]]]; Table[a[n], {n, 1, 101}] (* Jean-François Alcover, May 16 2013 *)
-
Python
from itertools import count, islice def agen(): # generator of terms a, products = [1, 2], {2} yield from a for k in count(3): if k not in products: yield k products.update(k*a[i] for i in range(len(a))) a.append(k) products.discard(k) print(list(islice(agen(), 62))) # Michael S. Branicky, Jun 09 2025
Extensions
More terms from Max Alekseyev, Sep 23 2007
Comments