A066512 Least nonnegative integer not the sum or product of any previous pair. a(1)=0.
0, 0, 1, 2, 4, 7, 10, 13, 16, 19, 22, 25, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57, 62, 65, 68, 71, 74, 77, 80, 83, 86, 89, 94, 97, 103, 106, 109, 115, 118, 121, 126, 129, 135, 138, 141, 147, 150, 153, 158, 161, 164, 167, 170, 173, 176, 179, 182, 185, 193, 196, 199
Offset: 1
Examples
a(13)=30, which is not a(i)+a(j) or a(i)*a(j) for any distinct i,j < 13.
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000
Programs
-
Python
from itertools import count, islice def agen(): # generator of terms a, sums, products = [0], set(), set() yield from a for k in count(0): if k not in sums and k not in products: yield k sums.update(k+a[i] for i in range(len(a))) products.update(k*a[i] for i in range(len(a))) a.append(k) sums.discard(k) products.discard(k) print(list(islice(agen(), 61))) # Michael S. Branicky, Jun 09 2025