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 A167615 #25 Feb 16 2025 08:33:11 %S A167615 1,15,165,1665,16664,166664,1666663,16666663,166666661,1666666662, %T A167615 16666666661,166666666660,1666666666661,16666666666660, %U A167615 166666666666659,1666666666666660,16666666666666658,166666666666666657,1666666666666666660,16666666666666666656 %N A167615 Total number of positive integers below 10^n with 4 positive squares in their representation as sum of squares. %C A167615 A049416(n) + A180416(n) + A180425(n) + a(n) = A002283(n). %H A167615 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/LagrangesFour-SquareTheorem.html">Lagrange's Four-Square Theorem</a>. %H A167615 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/SumofSquaresFunction.html">Sum of Squares Function</a>. %F A167615 a(n) = Sum_{i=0..k} ceiling(10^n/2^(2*i+3) - 7/8) with minimal k for which ceiling(10^n/2^(2*k+3) - 7/8) = 0. %e A167615 a(1) = 1 since 7 is the only natural number below 10 which is the sum of 4 but no fewer nonzero squares. %p A167615 a:=proc(n) %p A167615 local f,s,k; %p A167615 f:=(x,y)->ceil(10^y/2^(2*x+3)-7/8): %p A167615 s:=0: %p A167615 for k from 0 by 1 while not f(k,n)=0 do %p A167615 s:=s+f(k,n); %p A167615 od: %p A167615 return(s); %p A167615 end; %t A167615 a[n_] := Module[{f, s = 0, k}, f[x_, y_] := Ceiling[10^y/2^(2x+3) - 7/8]; For[k = 0, f[k, n] != 0, k++, s += f[k, n]]; Return[s]]; %t A167615 Array[a, 20] (* _Jean-François Alcover_, Oct 31 2020, after Maple *) %Y A167615 Cf. A004215. %K A167615 nonn %O A167615 1,2 %A A167615 _Martin Renner_, Jan 18 2011