login
A390396
Least positive integer not the sum, product or power of any previous pair of distinct terms.
1
1, 2, 4, 7, 10, 13, 18, 21, 24, 27, 30, 33, 38, 41, 44, 47, 50, 53, 58, 61, 64, 67, 73, 78, 81, 87, 90, 93, 98, 101, 104, 107, 110, 113, 118, 121, 124, 127, 133, 138, 141, 144, 149, 155, 158, 161, 172, 175, 178, 181, 184, 192, 195, 198, 201, 204, 209, 215, 218, 221, 224, 229, 235
OFFSET
1,2
LINKS
FORMULA
a(n+1) > a(n) for all n > 1 since 1 is a term and hence a(n) is in the set of products and a(n+1) >= a(n) by construction. - Michael S. Branicky, Nov 13 2025
PROG
(Python)
from itertools import combinations
def generate_sequence(n_terms):
sequence = [1]
while len(sequence) < n_terms:
sums = set()
prods = set()
powers = set()
for a, b in combinations(sequence, 2):
sums.add(a + b)
prods.add(a * b)
try:
powers.add(a ** b)
except OverflowError:
pass
try:
powers.add(b ** a)
except OverflowError:
pass
forbidden = sums.union(prods).union(powers)
candidate = 1
while candidate in sequence or candidate in forbidden:
candidate += 1
sequence.append(candidate)
return sequence
seq = generate_sequence(15)
(Python)
from math import isqrt
from itertools import count
def aupto(limit):
alst, an, aset, sums, prds, pows, r = [], 1, {1}, {1}, {1}, set(), isqrt(limit)+1
while an <= limit:
alst.append(an)
aset.add(an)
an = next(k for k in count(an+1) if all(k not in S for S in [sums, prds, pows]))
sums |= {t for s in aset if (t:= an+s) <= limit}
prds |= {t for p in aset if (t:= an*p) <= limit}
for p in aset:
if an > r or (t:=an**p) > limit: break
pows.add(t)
for p in aset:
if p > r or (t:=p**an) > limit: break
pows.add(t)
return alst
print(aupto(300)) # Michael S. Branicky, Nov 08 2025
CROSSREFS
Cf. A066512.
Sequence in context: A194172 A391537 A173537 * A049983 A168112 A170894
KEYWORD
nonn
AUTHOR
Marc Morgenegg, Nov 04 2025
STATUS
approved