OFFSET
1,1
COMMENTS
This is inspired by sequence A254337, where sums equal to prime numbers are disallowed.
An unproved conjecture (for the present sequence) is that all integers which are not nontrivial powers will eventually appear.
LINKS
EXAMPLE
Clearly 0 and 1 are powers of themselves so they are rejected. 2 is the first term. Then neither 3 nor (3+2) is a power so 3 is accepted. 4 is a power and thus rejected. (5+3) is 2^3, so reject (for now) 5. Same for 6; (7+3) and (7+3+2) are not powers, so 7 is accepted.
PROG
(R) # hasAnyPwr and helper function are in the GitHub link
(Python)
def is_pow(n, k):
while n%k == 0: n = n//k
return n == 1
def any_power(n):
return any((is_pow(n, k) for k in range(2, 1+n//2)))
terms, s, sums = [2, ], set((2, )), set((2, ))
for i in range(100):
t = 3
while t in s or any_power(t) or any((any_power(j + t) for j in sums)):
t+=1
s.add(t); terms.append(t)
sums = set(map(lambda k:k+t, sums))
sums.add(t)
print(terms) # Gleb Ivanov, Oct 07 2022
(PARI) See Links section.
CROSSREFS
KEYWORD
nonn
AUTHOR
Carl Witthoft, Oct 03 2022
STATUS
approved