cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A357579 Lexicographically earliest sequence of distinct numbers such that no sum of consecutive terms is a square or higher power of an integer.

This page as a plain text file.
%I A357579 #22 Oct 23 2022 04:33:00
%S A357579 2,3,7,5,6,12,10,11,17,18,15,13,20,14,23,19,28,26,22,21,29,33,35,37,
%T A357579 24,31,30,38,34,41,39,40,44,43,46,42,51,45,54,53,48,57,47,50,59,52,61,
%U A357579 58,55,60,56,66,67,65,62,70,63,69,73,72,76,74,68,79
%N A357579 Lexicographically earliest sequence of distinct numbers such that no sum of consecutive terms is a square or higher power of an integer.
%C A357579 This is inspired by sequence A254337, where sums equal to prime numbers are disallowed.
%C A357579 An unproved conjecture (for the present sequence) is that all integers which are not nontrivial powers will eventually appear.
%H A357579 Rémy Sigrist, <a href="/A357579/b357579.txt">Table of n, a(n) for n = 1..10000</a>
%H A357579 Rémy Sigrist, <a href="/A357579/a357579.gp.txt">PARI program</a>
%H A357579 Carl Witthoft, <a href="https://github.com/cellocgw/Rgoodies/blob/master/hasAnyPwr.R">R program</a>
%e A357579 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.
%o A357579 (R) # hasAnyPwr  and helper function are in the GitHub link
%o A357579 (Python)
%o A357579 def is_pow(n, k):
%o A357579     while n%k == 0: n = n//k
%o A357579     return n == 1
%o A357579 def any_power(n):
%o A357579     return any((is_pow(n, k) for k in range(2,1+n//2)))
%o A357579 terms,s,sums = [2,], set((2,)), set((2,))
%o A357579 for i in range(100):
%o A357579     t = 3
%o A357579     while t in s or any_power(t) or any((any_power(j + t) for j in sums)):
%o A357579         t+=1
%o A357579     s.add(t);terms.append(t)
%o A357579     sums = set(map(lambda k:k+t, sums))
%o A357579     sums.add(t)
%o A357579 print(terms) # _Gleb Ivanov_, Oct 07 2022
%o A357579 (PARI) See Links section.
%Y A357579 Cf. A254337.
%K A357579 nonn
%O A357579 1,1
%A A357579 _Carl Witthoft_, Oct 03 2022