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.
%I A321291 #12 Sep 19 2024 21:57:07 %S A321291 1,2,3,4,5,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22,23,24,26,27,28, %T A321291 32,34,36,38,40,42,44,46,48,52,54,56,64,68,72,76,80,84,88,92,96,104, %U A321291 108,112,128,136,144,152,160,168,176,184,192,208,216,224,256 %N A321291 Smallest positive number for which the 4th power cannot be written as sum of 4th powers of any subset of previous terms. %C A321291 a(n)^4 forms a sum-free sequence. %C A321291 It is noteworthy that the terms of this sequence increase slower than those of similar sequences for smaller (A321266, A321290) but also larger powers (A321292, A321293). %H A321291 Bert Dobbelaere, <a href="/A321291/b321291.txt">Table of n, a(n) for n = 1..104</a> %H A321291 Wikipedia, <a href="https://en.wikipedia.org/wiki/Sum-free_sequence">Sum-free sequence</a> %F A321291 a(n) = 2 * a(n-12) for n > 25 (conjectured). %e A321291 The smallest number > 0 that is not in the sequence is 15, because %e A321291 15^4 = 4^4 + 6^4 + 8^4 + 9^4 + 14^4. %o A321291 (Python) %o A321291 def findSum(nopt, tgt, a, smax, pwr): %o A321291 if nopt==0: %o A321291 return [] if tgt==0 else None %o A321291 if tgt<0 or tgt>smax[nopt-1]: %o A321291 return None %o A321291 rv=findSum(nopt-1, tgt - a[nopt-1]**pwr, a, smax, pwr) %o A321291 if rv!=None: %o A321291 rv.append(a[nopt-1]) %o A321291 else: %o A321291 rv=findSum(nopt-1, tgt, a, smax, pwr) %o A321291 return rv %o A321291 def A321291(n): %o A321291 POWER=4 ; x=0 ; a=[] ; smax=[] ; sumpwr=0 %o A321291 while len(a)<n: %o A321291 while True: %o A321291 x+=1 %o A321291 lst=findSum(len(a), x**POWER, a, smax, POWER) %o A321291 if lst==None: %o A321291 break %o A321291 rhs = " + ".join(["%d^%d"%(i, POWER) for i in lst]) %o A321291 print(" %d^%d = %s"%(x, POWER, rhs)) %o A321291 a.append(x) ; sumpwr+=x**POWER %o A321291 print("a(%d) = %d"%(len(a), x)) %o A321291 smax.append(sumpwr) %o A321291 return a[-1] %Y A321291 Other powers: A321266 (2), A321290 (3), A321292 (5), A321293 (6). %K A321291 nonn %O A321291 1,2 %A A321291 _Bert Dobbelaere_, Nov 02 2018