login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A000050 Number of positive integers <= 2^n of form x^2 + y^2.
(Formerly M0715 N0265)
3
1, 2, 3, 5, 9, 16, 29, 54, 97, 180, 337, 633, 1197, 2280, 4357, 8363, 16096, 31064, 60108, 116555, 226419, 440616, 858696, 1675603, 3273643, 6402706, 12534812, 24561934, 48168461, 94534626, 185661958, 364869032, 717484560, 1411667114, 2778945873, 5473203125 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,2

REFERENCES

P. Moree and H. J. J. te Riele, The hexagonal versus the square lattice, Math. Comp. 73 (2004), no. 245, 451-473.

D. Shanks and L. P. Schmid, Variations on a theorem of Landau. Part I, Math. Comp., 20 (1966), 551-569.

N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).

N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

LINKS

Table of n, a(n) for n=0..35.

P. Moree and H. J. J. te Riele, The hexagonal versus the square lattice

Index entries for sequences related to populations of quadratic forms

MATHEMATICA

(* This program is not suitable for a large number of terms *) a[0] = 1; a[n_] := a[n] = (For[cnt = 0; k = 2^(n-1)+1, k <= 2^n, k++, If[SquaresR[2, k] > 0, cnt++]]; cnt + a[n-1]); Table[Print["a(", n, ") = ", a[n]]; a[n], {n, 0, 26}] (* Jean-Fran├žois Alcover, Mar 20 2014 *)

PROG

(Haskell)

isqrt = a000196

issquare = a010052

a000050 n = foldl f 0 [1..2^n]

  where f i j = if a000050' j > 0 then i + 1 else i

a000050' k = foldl f 0 (h k)

  where f i y = g y + i

          where g y = issquare (k - y^2)

        h k = [0..isqrt k]

-- James Spahlinger, Oct 09 2012

CROSSREFS

Sequence in context: A255071 A103285 A000049 * A050253 A198518 A182558

Adjacent sequences:  A000047 A000048 A000049 * A000051 A000052 A000053

KEYWORD

nonn

AUTHOR

N. J. A. Sloane

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy .

Last modified May 22 19:31 EDT 2017. Contains 286885 sequences.