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.

A297345 a(0)=0; for n>0, a(n) is the least positive integer that cannot be represented as Sum_{k=1..n-1} a(i_k)*a(k), with 0 <= i_k < n.

This page as a plain text file.
%I A297345 #65 May 24 2021 08:00:23
%S A297345 0,1,2,7,24,85,285,1143,6268,216784,1059813,6100794,226303113
%N A297345 a(0)=0; for n>0, a(n) is the least positive integer that cannot be represented as Sum_{k=1..n-1} a(i_k)*a(k), with 0 <= i_k < n.
%e A297345 a(1)= 1 since it is not possible to write 1 using only a(0). a(2)=2, since it is not possible to obtain 2 using only a(0) and a(1). The following numbers up to 6 can be represented using these first 3 elements of the sequence: 3 = 1*1 + 1*2, 4 = 0*1 + 2*2, 5 = 1*1 + 2*2, 6 = 2*1 + 2*2. Again we reach a number that cannot be represented as defined above, so that number is appended to the sequence. It happens here when we try to represent 7 using only a(0)=0, a(1)=1, and a(2)=2. So 7 becomes a(3).
%e A297345 A larger example: 216752 = 1*1 + 1*2 + 85*7 + 285*24 + 85*85 + 85*285 + 24*1143 + 24*6268
%t A297345 Nest[Function[a, Append[a, 1 + LengthWhile[Differences@ #, # == 1 &] &@ Union[Total /@ Map[a # &, Tuples[a, Length@ a]]]]], {0}, 8] (* _Michael De Vlieger_, Jan 09 2018 *)
%o A297345 (Python)
%o A297345 # Generate all the elements in the sequence, S, necessary to represent all
%o A297345 # numbers until the integer 'last'. It also shows how each integer is
%o A297345 # represented by showing the sequence elements and the respective
%o A297345 # multiplicative factors.
%o A297345 import numpy as np
%o A297345 import itertools
%o A297345 last=100
%o A297345 def generate(i,S):
%o A297345     n=len(S)
%o A297345     s=np.asarray(S,dtype=np.int)
%o A297345     perms = [p for p in itertools.product(S, repeat=n)]
%o A297345     for iks in perms:
%o A297345         t=np.asarray(iks)
%o A297345         if np.dot(t,s) == i:
%o A297345             print('%d=' %i, end=',')
%o A297345             print(t,'x',s)
%o A297345             return 0
%o A297345     return -1
%o A297345 S=[0]
%o A297345 for i in range(1,last+1):
%o A297345         if generate(i,S) == -1:
%o A297345             S.append(i)
%o A297345             generate(i,S)
%K A297345 nonn,more,hard
%O A297345 0,3
%A A297345 _Luis F.B.A. Alexandre_, Dec 28 2017
%E A297345 a(9) from _Robert G. Wilson v_, Jan 09 2018
%E A297345 a(10)-a(11) from _Jon E. Schoenfield_, Jan 16 2018
%E A297345 a(12) from _Giovanni Resta_, Jan 22 2018