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!)
A180416 Number of positive integers below 10^n, excluding perfect squares, which have a representation as a sum of 2 positive squares. 6

%I #39 Oct 31 2020 15:51:33

%S 3,33,298,2649,23711,215341,1982296,18447847,173197435,1637524156,

%T 15570196516,148735628858,1426303768587,13722207893214,

%U 132387231596281,1280309591127436

%N Number of positive integers below 10^n, excluding perfect squares, which have a representation as a sum of 2 positive squares.

%C Numbers that can be represented as a sum of three or more positive squares but not as a sum of two positive squares (e.g., 3=1^2+1^2+1^2 or 6=1^2+1^2+2^2) are not counted. Numbers that can be represented as a sum of two positive squares and alternatively as a sum of three or more positive squares are counted (e.g., 18 = 9+9 = 1+1+16, 26, 41, ...).

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

%H Eric W. Weisstein: <a href="http://mathworld.wolfram.com/SumofSquaresFunction.html">MathWorld -- Sum of Squares Function.</a>

%F a(n) = |{ 0<k<10^n : k in {A000415} }|.

%F a(n) = |{ 0<k<10^n : k in ({A000404} \ {A000290}) }|.

%F a(n) = A002283(n) - A049416(n) - A167615(n) - A180425(n).

%p isA000415 := proc(n) local x ,y2; if issqr(n) then false; else for x from 1 do y2 := n-x^2 ; if y2 < x^2 then return false; elif issqr(y2) then return true; end if; end do ; end if; end proc:

%p A180416 := proc(n) a := 0 ; for k from 2 to 10^n-1 do if isA000415(k) then a := a+1 ; end if; end do: a ; end proc:

%p for n from 1 do print(A180416(n)) ; end do; # _R. J. Mathar_, Jan 20 2011

%t a[n_] := a[n] = Module[{k, xMax = Floor[Sqrt[10^n - 1]]}, Table[k = x^2 + y^2; If[IntegerQ[Sqrt[k]], Nothing, k], {x, 1, xMax}, {y, x, Floor[ Sqrt[10^n - 1 - x^2]]}] // Flatten // Union // Length];

%t Table[Print[n, " ", a[n]]; a[n], {n, 1, 8}] (* _Jean-François Alcover_, Oct 31 2020 *)

%Y Cf. A000415, A000404, A000290, A002283, A049416, A167613, A180425.

%K nonn,more

%O 1,1

%A _Martin Renner_, Jan 19 2011

%E a(6)-a(8) from _Alois P. Heinz_, Jan 20 2011

%E a(9)-a(10) from _Donovan Johnson_, Feb 04 2011

%E a(10) corrected and a(11)-a(16) from _Hiroaki Yamanouchi_, Jul 13 2014

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 April 24 20:08 EDT 2024. Contains 371963 sequences. (Running on oeis4.)