OFFSET
1,2
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
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
KEYWORD
nonn
AUTHOR
Marc Morgenegg, Nov 04 2025
STATUS
approved
