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

 

Logo

Annual Appeal: Please make a donation (tax deductible in USA) to keep the OEIS running. Over 5000 articles have referenced us, often saying "we discovered this result with the help of the OEIS".

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A000161 Number of partitions of n into 2 squares. 50
1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 2, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 2, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 2, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 2, 1, 0, 0, 1, 0, 1, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,26

COMMENTS

Number of ways of writing n as a sum of 2 (possibly zero) squares when order does not matter.

Number of similar sublattices of square lattice with index n.

Let Pk = the number of partitions of n into k nonzero squares. Then we have A000161 = P0 + P1 + P2, A002635 = P0 + P1 + P2 + P3 + P4, A010052 = P1, A025426 = P2, A025427 = P3, A025428 = P4. - Charles R Greathouse IV, Mar 08 2010, amended by M. F. Hasler, Jan 25 2013

a(A022544(n))=0; a(A001481(n))>0; a(A125022(n))=1; a(A118882(n))>1. - Reinhard Zumkeller, Aug 16 2011

REFERENCES

J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939, p. 339

LINKS

T. D. Noe, Table of n, a(n) for n = 0..10000

B. K. Agarwala and F. C. Auluck, Statistical mechanics and partitions into non-integral powers of integers, Proc. Camb. Phil. Soc., 47 (1951), 207-216. [Annotated scanned copy]

H. Bottomley, Illustration of initial terms

R. T. Bumby, Sums of four squares, in Number theory (New York, 1991-1995), 1-8, Springer, New York, 1996.

J. H. Conway, E. M. Rains and N. J. A. Sloane, On the existence of similar sublattices, Canad. J. Math. 51 (1999), 1300-1306 (Abstract, pdf, ps).

Michael Gilleland, Some Self-Similar Integer Sequences

E. Grosswald, Representations of Integers as Sums of Squares, Springer-Verlag, NY, 1985, p. 84.

M. D. Hirschhorn, Some formulas for partitions into squares, Discrete Math, 211 (2000), pp. 225-228. [From Ant King, Oct 05 2010]

Index entries for sequences related to sublattices

Index entries for sequences related to sums of squares

Index entries for "core" sequences

FORMULA

a(n) = card { { a,b } c N | a^2+b^2 = n }. - M. F. Hasler, Nov 23 2007

Let f(n)= the number of divisors of n that are congruent to 1 modulo 4 minus the number of its divisors that are congruent to 3 modulo 4, and define delta(n) to be 1 if n is a perfect square and 0 otherwise. Then a(n)=1/2 (f(n)+delta(n)+delta(1/2 n)). - Ant King, Oct 05 2010

EXAMPLE

25 = 3^2+4^2 = 5^2, so a(25) = 2.

MAPLE

A000161 := proc(n) local i, j, ans; ans := 0; for i from 0 to n do for j from i to n do if i^2+j^2=n then ans := ans+1 fi od od; RETURN(ans); end; [ seq(A000161(i), i=0..50) ];

A000161 := n -> nops( numtheory[sum2sqr](n) ); # M. F. Hasler, Nov 23 2007

MATHEMATICA

Length[PowersRepresentations[ #, 2, 2]] &/@Range[0, 150] (* Ant King, Oct 05 2010 *)

PROG

(PARI) A000161(n)=sum(i=0, n, sum(j=0, i, if(i^2+j^2-n, 0, 1)))

(PARI) A000161(n)=sum(i=0, sqrtint(n>>1), issquare(n-i^2)) \\ M. F. Hasler, Nov 23 2007

(PARI) a(n)=sum(k=sqrtint((n-1)\2)+1, sqrtint(n), issquare(n-k^2)) \\ Charles R Greathouse IV, Mar 21 2014

(Haskell)

a000161 n =

   sum $ map (a010052 . (n -)) $ takeWhile (<= n `div` 2) a000290_list

a000161_list = map a000161 [0..]

-- Reinhard Zumkeller, Aug 16 2011

CROSSREFS

Cf. A002654, A001481, A002635, A025427, A025428, A063725, A025426, A000290, A010052.

Cf. A000925, A247367.

Sequence in context: A056973 A107782 A086017 * A060398 A253242 A260649

Adjacent sequences:  A000158 A000159 A000160 * A000162 A000163 A000164

KEYWORD

nonn,core,easy,nice

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 December 3 08:48 EST 2016. Contains 278698 sequences.