login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A357579
Lexicographically earliest sequence of distinct numbers such that no sum of consecutive terms is a square or higher power of an integer.
5
2, 3, 7, 5, 6, 12, 10, 11, 17, 18, 15, 13, 20, 14, 23, 19, 28, 26, 22, 21, 29, 33, 35, 37, 24, 31, 30, 38, 34, 41, 39, 40, 44, 43, 46, 42, 51, 45, 54, 53, 48, 57, 47, 50, 59, 52, 61, 58, 55, 60, 56, 66, 67, 65, 62, 70, 63, 69, 73, 72, 76, 74, 68, 79
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
Rémy Sigrist, PARI program
Carl Witthoft, R program
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
Cf. A254337.
Sequence in context: A235801 A076986 A333386 * A334126 A341717 A225403
KEYWORD
nonn
AUTHOR
Carl Witthoft, Oct 03 2022
STATUS
approved