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!)
A001481 Numbers that are the sum of 2 squares.
(Formerly M0968 N0361)
228

%I M0968 N0361 #251 Apr 16 2024 01:39:50

%S 0,1,2,4,5,8,9,10,13,16,17,18,20,25,26,29,32,34,36,37,40,41,45,49,50,

%T 52,53,58,61,64,65,68,72,73,74,80,81,82,85,89,90,97,98,100,101,104,

%U 106,109,113,116,117,121,122,125,128,130,136,137,144,145,146,148,149,153,157,160

%N Numbers that are the sum of 2 squares.

%C Numbers n such that n = x^2 + y^2 has a solution in nonnegative integers x, y.

%C Closed under multiplication. - _David W. Wilson_, Dec 20 2004

%C Also, numbers whose cubes are the sum of 2 squares. - _Artur Jasinski_, Nov 21 2006 (Cf. A125110.)

%C Terms are the squares of smallest radii of circles covering (on a square grid) a number of points equal to the terms of A057961. - Philippe Lallouet (philip.lallouet(AT)wanadoo.fr), Apr 16 2007. [Comment corrected by _T. D. Noe_, Mar 28 2008]

%C Numbers with more 4k+1 divisors than 4k+3 divisors. If a(n) is a member of this sequence, then so too is any power of a(n). - _Ant King_, Oct 05 2010

%C A000161(a(n)) > 0; A070176(a(n)) = 0. - _Reinhard Zumkeller_, Feb 04 2012, Aug 16 2011

%C Numbers that are the norms of Gaussian integers. This sequence has unique factorization; the primitive elements are A055025. - _Franklin T. Adams-Watters_, Nov 25 2011

%C These are numbers n such that all of n's odd prime factors congruent to 3 modulo 4 occur to an even exponent (Fermat's two-squares theorem). - _Jean-Christophe Hervé_, May 01 2013

%C Let's say that an integer n divides a lattice if there exists a sublattice of index n. Example: 2, 4, 5 divide the square lattice. The present sequence without 0 is the sequence of divisors of the square lattice. Say that n is a "prime divisor" if the index-n sublattice is not contained in any other sublattice except the original lattice itself. Then A055025 (norms of Gaussian primes) gives the "prime divisors" of the square lattice. - _Jean-Christophe Hervé_, May 01 2013

%C For any i,j > 0 a(i)*a(j) is a member of this sequence, since (a^2 + b^2)*(c^2 + d^2) = (a*c + b*d)^2 + (a*d - b*c)^2. - _Boris Putievskiy_, May 05 2013

%C The sequence is closed under multiplication. Primitive elements are in A055025. The sequence can be split into 3 multiplicatively closed subsequences: {0}, A004431 and A125853. - _Jean-Christophe Hervé_, Nov 17 2013

%C Generalizing Jasinski's comment, same as numbers whose odd powers are the sum of 2 squares, by Fermat's two-squares theorem. - _Jonathan Sondow_, Jan 24 2014

%C By the 4 squares theorem, every nonnegative integer can be expressed as the sum of two elements of this sequence. - _Franklin T. Adams-Watters_, Mar 28 2015

%C There are never more than 3 consecutive terms. Runs of 3 terms start at 0, 8, 16, 72, ... (A082982). - _Ivan Neretin_, Nov 09 2015

%C Conjecture: barring the 0+2, 0+4, 0+8, 0+16, ... sequence, the sum of 2 distinct terms in this sequence is never a power of 2. - _J. Lowell_, Jan 14 2022

%C All the areas of squares whose vertices have integer coordinates. - _Neeme Vaino_, Jun 14 2023

%C Numbers represented by the definite binary quadratic forms x^2 + 2nxy + (n^2+1)y^2 for any integer n. This sequence contains the even powers of any integer. An odd power of a number appears only if the number itself belongs to the sequence. The equation given in the comment by Boris Putievskiy 2013 is Brahmagupta's identity with n = 1. It proves that any set of numbers of the form a^2 + nb^2 is closed under multiplication. - _Klaus Purath_, Sep 06 2023

%D J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 106.

%D David A. Cox, "Primes of the Form x^2 + n y^2", Wiley, 1989.

%D L. Euler, (E388) Vollständige Anleitung zur Algebra, Zweiter Theil, reprinted in: Opera Omnia. Teubner, Leipzig, 1911, Series (1), Vol. 1, p. 417.

%D S. R. Finch, Mathematical Constants, Cambridge, 2003, pp. 98-104.

%D G. H. Hardy, Ramanujan, pp. 60-63.

%D P. Moree and J. Cazaran, On a claim of Ramanujan in his first letter to Hardy, Expos. Math. 17 (1999), pp. 289-312.

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

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

%H T. D. Noe, <a href="/A001481/b001481.txt">Table of n, a(n) for n = 1..10000</a>

%H Michael Baake, Uwe Grimm, Dieter Joseph and Przemyslaw Repetowicz, <a href="https://arxiv.org/abs/math/9907156">Averaged shelling for quasicrystals</a>, arXiv:math/9907156 [math.MG], 1999.

%H Henry Bottomley, <a href="/A001481/a001481.gif">Illustration of initial terms</a>

%H Richard T. Bumby, <a href="http://www.math.rutgers.edu/~bumby/squares1.pdf">Sums of four squares</a>, in Number theory (New York, 1991-1995), 1-8, Springer, New York, 1996.

%H John Butcher, <a href="http://www.math.auckland.ac.nz/~butcher/miniature/miniature7.pdf">Quadratic residues and sums of two squares</a>

%H John Butcher, <a href="http://www.math.auckland.ac.nz/~butcher/miniature/miniature14.pdf">Sums of two squares revisited</a>

%H Leonhard Euler, <a href="http://www.mathematik.uni-bielefeld.de/~sieben/euler/euler_2.djvu">Vollständige Anleitung zur Algebra, Zweiter Teil</a>; see also <a href="https://www.deutschestextarchiv.de/book/view/euler_algebra02_1770">Deutsches Textarchiv</a>

%H Steven R. Finch, <a href="http://www.people.fas.harvard.edu/~sfinch/constant/lr/lr.html">Landau-Ramanujan Constant</a> [broken link]

%H Steven R. Finch, <a href="http://web.archive.org/web/20010605004309/http://www.mathsoft.com/asolve/constant/lr/lr.html">Landau-Ramanujan Constant</a> [From the Wayback Machine]

%H Steven R. Finch, <a href="http://www.people.fas.harvard.edu/~sfinch/csolve/fermat.pdf">On a Generalized Fermat-Wiles Equation</a> [broken link]

%H Steven R. Finch, <a href="http://web.archive.org/web/20010602030546/http://www.mathsoft.com/asolve/fermat/fermat.html">On a Generalized Fermat-Wiles Equation</a> [From the Wayback Machine]

%H J. W. L. Glaisher, <a href="/A002654/a002654.pdf">On the function which denotes the difference between the number of (4m+1)-divisors and the number of (4m+3)-divisors of a number</a>, Proc. London Math. Soc., 15 (1884), 104-122. [Annotated scanned copy of pages 104-107 only]

%H Leonor Godinho, Nicholas Lindsay, and Silvia Sabatini, <a href="https://arxiv.org/abs/2403.00949">On a symplectic generalization of a Hirzebruch problem</a>, arXiv:2403.00949 [math.SG], 2024. See p. 17.

%H Darij Grinberg, <a href="https://web.archive.org/web/20210628002857/http://www-users.math.umn.edu/~dgrinber/19s/notes.pdf">UMN Spring 2019 Math 4281 notes</a>, University of Minnesota, College of Science & Engineering, 2019. [Wayback Machine copy]

%H Shuo Li, <a href="https://arxiv.org/abs/2404.08822">The characteristic sequence of the integers that are the sum of two squares is not morphic</a>, arXiv:2404.08822 [math.NT], 2024.

%H Thomas Nickson and Igor Potapov, <a href="http://arxiv.org/abs/1410.0573">Broadcasting Automata and Patterns on Z^2</a>, arXiv preprint arXiv:1410.0573 [cs.FL], 2014.

%H Michael Penn, <a href="https://www.youtube.com/playlist?list=PL22w63XsKjqyloZuYhnlXi4-5NbSdRhjC">Sums of Squares</a>, Youtube playlist, 2019, 2020.

%H Peter Shiu, <a href="http://dx.doi.org/10.1090/S0025-5718-1986-0842141-1">Counting Sums of Two Squares: The Meissel-Lehmer Method</a>, Mathematics of Computation 47 (1986), 351-360.

%H N. J. A. Sloane et al., <a href="https://oeis.org/wiki/Binary_Quadratic_Forms_and_OEIS">Binary Quadratic Forms and OEIS</a> (Index to related sequences, programs, references)

%H William A. Stein, <a href="http://wstein.org/edu/124/lectures/lecture21/lecture21.ps">Quadratic Forms:Sums of Two Squares</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/SquareNumber.html">Square Number</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/GeneralizedFermatEquation.html">Generalized Fermat Equation</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Landau-RamanujanConstant.html">Landau-Ramanujan Constant</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/GaussianInteger.html">Gaussian Integer</a>

%H A. van Wijngaarden, <a href="https://autodocbox.com/Hatchback/67300596-A-table-of-partitions-into-two-squares-with-an-application-to-rational-triangles.html">A table of partitions into two squares with an application to rational triangles</a>, Proceedings of the Koninklijke Nederlandse Akademie van Wetenschappen, Series A, 53 (1950), 869-875.

%H Gang Xiao, <a href="http://wims.unice.fr/~wims/en_tool~number~twosquares.en.html">Two squares</a>

%H <a href="/index/Su#ssq">Index entries for sequences related to sums of squares</a>

%H <a href="/index/Cor#core">Index entries for "core" sequences</a>

%F n = square * 2^{0 or 1} * {product of distinct primes == 1 (mod 4)}.

%F The number of integers less than N that are sums of two squares is asymptotic to constant*N/sqrt(log(N)), hence lim_{n->infinity} a(n)/n = infinity.

%F Nonzero terms in expansion of Dirichlet series Product_p (1 - (Kronecker(m, p) + 1)*p^(-s) + Kronecker(m, p)*p^(-2s))^(-1) for m = -1.

%F a(n) ~ k*n*sqrt(log n), where k = 1.3085... = 1/A064533. - _Charles R Greathouse IV_, Apr 16 2012

%F There are B(x) = x/sqrt(log x) * (K + B2/log x + O(1/log^2 x)) terms of this sequence up to x, where K = A064533 and B2 = A227158. - _Charles R Greathouse IV_, Nov 18 2022

%p readlib(issqr): for n from 0 to 160 do for k from 0 to floor(sqrt(n)) do if issqr(n-k^2) then printf(`%d,`,n); break fi: od: od:

%t upTo = 160; With[{max = Ceiling[Sqrt[upTo]]}, Select[Union[Total /@ (Tuples[Range[0, max], {2}]^2)], # <= upTo &]] (* _Harvey P. Dale_, Apr 22 2011 *)

%t Select[Range[0, 160], SquaresR[2, #] != 0 &] (* _Jean-François Alcover_, Jan 04 2013 *)

%o (PARI) isA001481(n)=local(x,r);x=0;r=0;while(x<=sqrt(n) && r==0,if(issquare(n-x^2),r=1);x++);r \\ _Michael B. Porter_, Oct 31 2009

%o (PARI) is(n)=my(f=factor(n));for(i=1,#f[,1],if(f[i,2]%2 && f[i,1]%4==3, return(0))); 1 \\ _Charles R Greathouse IV_, Aug 24 2012

%o (PARI) B=bnfinit('z^2+1,1);

%o is(n)=#bnfisintnorm(B,n) \\ _Ralf Stephan_, Oct 18 2013, edited by _M. F. Hasler_, Nov 21 2017

%o (PARI) list(lim)=my(v=List(),t); for(m=0,sqrtint(lim\=1), t=m^2; for(n=0, min(sqrtint(lim-t),m), listput(v,t+n^2))); Set(v) \\ _Charles R Greathouse IV_, Jan 05 2016

%o (PARI) is_A001481(n)=!for(i=2-bittest(n,0),#n=factor(n)~, bittest(n[1,i],1)&&bittest(n[2,i],0)&&return) \\ _M. F. Hasler_, Nov 20 2017

%o (Haskell)

%o a001481 n = a001481_list !! (n-1)

%o a001481_list = [x | x <- [0..], a000161 x > 0]

%o -- _Reinhard Zumkeller_, Feb 14 2012, Aug 16 2011

%o (Magma) [n: n in [0..160] | NormEquation(1, n) eq true]; // _Arkadiusz Wesolowski_, May 11 2016

%o (Python)

%o from itertools import count, islice

%o from sympy import factorint

%o def A001481_gen(): # generator of terms

%o return filter(lambda n:(lambda m:all(d & 3 != 3 or m[d] & 1 == 0 for d in m))(factorint(n)),count(0))

%o A001481_list = list(islice(A001481_gen(),30)) # _Chai Wah Wu_, Jun 27 2022

%Y Disjoint union of A000290 and A000415.

%Y Complement of A022544.

%Y Cf. A004018, A000161, A002654, A064533, A055025, A002828, A000378, A025284-A025320, A125110, A118882, A125022.

%Y A000404 gives another version. Subsequence of A091072, supersequence of A046711.

%Y Cf. A057961, A232499, A077773, A363763.

%Y Column k=2 of A336820.

%K nonn,nice,easy,core,changed

%O 1,3

%A _N. J. A. Sloane_

%E Deleted an incorrect comment. - _N. J. A. Sloane_, Oct 03 2023

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 25 05:18 EDT 2024. Contains 371964 sequences. (Running on oeis4.)