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.

A321292 Smallest positive number for which the 5th power cannot be written as sum of distinct 5th powers of any subset of previous terms.

This page as a plain text file.
%I A321292 #13 Sep 19 2024 21:57:03
%S A321292 1,2,3,4,5,6,7,8,9,10,11,13,14,15,16,17,18,19,20,21,22,25,26,27,28,30,
%T A321292 37,43,44,55,57,64,77,82,90,97,112,116,119,154,156,178,202,227,269,
%U A321292 309,335,371,397,442,516,604,643,722,774,815,1000,1115,1308,1503
%N A321292 Smallest positive number for which the 5th power cannot be written as sum of distinct 5th powers of any subset of previous terms.
%C A321292 a(n)^5 forms a sum-free sequence.
%H A321292 Bert Dobbelaere, <a href="/A321292/b321292.txt">Table of n, a(n) for n = 1..150</a>
%H A321292 Wikipedia, <a href="https://en.wikipedia.org/wiki/Sum-free_sequence">Sum-free sequence</a>
%e A321292 The smallest number > 0 that is not in the sequence is 12, because
%e A321292 12^5 = 4^5 + 5^5 + 6^5 + 7^5 + 9^5 + 11^5.
%o A321292 (Python)
%o A321292 def findSum(nopt, tgt, a, smax, pwr):
%o A321292     if nopt==0:
%o A321292         return [] if tgt==0 else None
%o A321292     if tgt<0 or tgt>smax[nopt-1]:
%o A321292         return None
%o A321292     rv=findSum(nopt-1, tgt - a[nopt-1]**pwr, a, smax, pwr)
%o A321292     if rv!=None:
%o A321292         rv.append(a[nopt-1])
%o A321292     else:
%o A321292         rv=findSum(nopt-1, tgt, a, smax, pwr)
%o A321292     return rv
%o A321292 def A321292(n):
%o A321292     POWER=5 ; x=0 ; a=[] ; smax=[] ; sumpwr=0
%o A321292     while len(a)<n:
%o A321292         while True:
%o A321292             x+=1
%o A321292             lst=findSum(len(a), x**POWER, a, smax, POWER)
%o A321292             if lst==None:
%o A321292                 break
%o A321292             rhs = " + ".join(["%d^%d"%(i, POWER) for i in lst])
%o A321292             print("    %d^%d = %s"%(x, POWER, rhs))
%o A321292         a.append(x) ; sumpwr+=x**POWER
%o A321292         print("a(%d) = %d"%(len(a), x))
%o A321292         smax.append(sumpwr)
%o A321292     return a[-1]
%Y A321292 Other powers: A321266 (2), A321290 (3), A321291 (4), A321293 (6).
%K A321292 nonn
%O A321292 1,2
%A A321292 _Bert Dobbelaere_, Nov 02 2018