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 A262123 #30 May 22 2025 10:21:43 %S A262123 1,1,1,4,16,144,7056,13046544,42600214749456, %T A262123 453694852221644777216198544, %U A262123 51459754733114686962148583539748993964925660496781456 %N A262123 a(1) + a(2) + ... + a(n) is the representation as a sum of n squares of the smallest integer needing n squares (using the greedy algorithm). %H A262123 E. Lemoine, <a href="http://gallica.bnf.fr/ark:/12148/bpt6k30518/f719.image">Décomposition d'un nombre entier N en ses puissances nièmes maxima</a>, C. R. Acad. Sci. Paris, Vol. 95, pp. 719-722, 1882. %F A262123 a(1)=1; for n>1, if s = a(1)+a(2)+...+a(n-1) then a(n+1) = floor((s+1)/2)^2. %F A262123 a(1)+...+a(n) = A006892(n). %F A262123 a(1)=a(2)=a(3)=1, a(4)=4; for n>=4, a(n+1) = ( a(n)/2+sqrt(a(n)) )^2. %e A262123 23 =16+4+1+1+1 is the first number to need 5 squares for its greedy decomposition, so a(1)=1,a(2)=1,a(3)=1,a(4)=4,a(5)=16. %p A262123 a:=n->if n=1 then 1 else s:=add(a(k),k=1..n-1); floor((s+1)/2)^2 fi; %t A262123 a[1] = 1; a[n_] := a[n] = Floor[(Total[Array[a, n-1]]+1)/2]^2; Array[a, 11] (* _Jean-François Alcover_, Oct 05 2015 *) %o A262123 (Python) %o A262123 def list_a(n): %o A262123 list=[1,1,1,4];root=2;length=4 %o A262123 while length<n: %o A262123 root=root**2//2+root %o A262123 list.append(root**2) %o A262123 length+=1 %o A262123 return list %o A262123 list_a(12) %o A262123 (PARI) a(n) = if(n<4, 1,if(n==4, 4,(a(n-1)/2 + sqrtint(a(n-1)))^2)); %o A262123 vector(12, n, a(n)) \\ _Altug Alkan_, Oct 04 2015 %Y A262123 Cf. A006892. %K A262123 nonn %O A262123 1,4 %A A262123 _Robert FERREOL_, Sep 11 2015