The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A167615 Total number of positive integers below 10^n with 4 positive squares in their representation as sum of squares. 4

%I #24 Oct 31 2020 12:50:57

%S 1,15,165,1665,16664,166664,1666663,16666663,166666661,1666666662,

%T 16666666661,166666666660,1666666666661,16666666666660,

%U 166666666666659,1666666666666660,16666666666666658,166666666666666657,1666666666666666660,16666666666666666656

%N Total number of positive integers below 10^n with 4 positive squares in their representation as sum of squares.

%C A049416(n) + A180416(n) + A180425(n) + a(n) = A002283(n).

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/LagrangesFour-SquareTheorem.html">Lagrange's Four-Square Theorem</a>.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/SumofSquaresFunction.html">Sum of Squares Function</a>.

%F 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 a(1) = 1 since 7 is the only natural number below 10 which is the sum of 4 but no fewer nonzero squares.

%p a:=proc(n)

%p local f,s,k;

%p f:=(x,y)->ceil(10^y/2^(2*x+3)-7/8):

%p s:=0:

%p for k from 0 by 1 while not f(k,n)=0 do

%p s:=s+f(k,n);

%p od:

%p return(s);

%p end;

%t 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 Array[a, 20] (* _Jean-François Alcover_, Oct 31 2020, after Maple *)

%Y Cf. A004215.

%K nonn

%O 1,2

%A _Martin Renner_, Jan 18 2011

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 28 15:56 EDT 2024. Contains 372916 sequences. (Running on oeis4.)