cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-8 of 8 results.

A001481 Numbers that are the sum of 2 squares.

Original entry on oeis.org

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, 52, 53, 58, 61, 64, 65, 68, 72, 73, 74, 80, 81, 82, 85, 89, 90, 97, 98, 100, 101, 104, 106, 109, 113, 116, 117, 121, 122, 125, 128, 130, 136, 137, 144, 145, 146, 148, 149, 153, 157, 160
Offset: 1

Views

Author

Keywords

Comments

Numbers n such that n = x^2 + y^2 has a solution in nonnegative integers x, y.
Closed under multiplication. - David W. Wilson, Dec 20 2004
Also, numbers whose cubes are the sum of 2 squares. - Artur Jasinski, Nov 21 2006 (Cf. A125110.)
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]
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
A000161(a(n)) > 0; A070176(a(n)) = 0. - Reinhard Zumkeller, Feb 04 2012, Aug 16 2011
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
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
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
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
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
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
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
There are never more than 3 consecutive terms. Runs of 3 terms start at 0, 8, 16, 72, ... (A082982). - Ivan Neretin, Nov 09 2015
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
All the areas of squares whose vertices have integer coordinates. - Neeme Vaino, Jun 14 2023
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

References

  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 106.
  • David A. Cox, "Primes of the Form x^2 + n y^2", Wiley, 1989.
  • L. Euler, (E388) Vollständige Anleitung zur Algebra, Zweiter Theil, reprinted in: Opera Omnia. Teubner, Leipzig, 1911, Series (1), Vol. 1, p. 417.
  • S. R. Finch, Mathematical Constants, Cambridge, 2003, pp. 98-104.
  • G. H. Hardy, Ramanujan, pp. 60-63.
  • P. Moree and J. Cazaran, On a claim of Ramanujan in his first letter to Hardy, Expos. Math. 17 (1999), pp. 289-312.
  • 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).

Crossrefs

Disjoint union of A000290 and A000415.
Complement of A022544.
A000404 gives another version. Subsequence of A091072, supersequence of A046711.
Column k=2 of A336820.

Programs

  • Haskell
    a001481 n = a001481_list !! (n-1)
    a001481_list = [x | x <- [0..], a000161 x > 0]
    -- Reinhard Zumkeller, Feb 14 2012, Aug 16 2011
    
  • Magma
    [n: n in [0..160] | NormEquation(1, n) eq true]; // Arkadiusz Wesolowski, May 11 2016
    
  • Maple
    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:
  • Mathematica
    upTo = 160; With[{max = Ceiling[Sqrt[upTo]]}, Select[Union[Total /@ (Tuples[Range[0, max], {2}]^2)], # <= upTo &]]  (* Harvey P. Dale, Apr 22 2011 *)
    Select[Range[0, 160], SquaresR[2, #] != 0 &] (* Jean-François Alcover, Jan 04 2013 *)
  • 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
    
  • 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
    
  • PARI
    B=bnfinit('z^2+1,1);
    is(n)=#bnfisintnorm(B,n) \\ Ralf Stephan, Oct 18 2013, edited by M. F. Hasler, Nov 21 2017
    
  • 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
    
  • 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
    
  • Python
    from itertools import count, islice
    from sympy import factorint
    def A001481_gen(): # generator of terms
        return filter(lambda n:(lambda m:all(d & 3 != 3 or m[d] & 1 == 0 for d in m))(factorint(n)),count(0))
    A001481_list = list(islice(A001481_gen(),30)) # Chai Wah Wu, Jun 27 2022

Formula

n = square * 2^{0 or 1} * {product of distinct primes == 1 (mod 4)}.
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.
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.
a(n) ~ k*n*sqrt(log n), where k = 1.3085... = 1/A064533. - Charles R Greathouse IV, Apr 16 2012
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

Extensions

Deleted an incorrect comment. - N. J. A. Sloane, Oct 03 2023

A025301 Numbers that are the sum of 2 nonzero squares in 10 or more ways.

Original entry on oeis.org

138125, 160225, 204425, 226525, 235625, 276250, 292825, 300625, 308125, 320450, 333125, 337025, 348725, 359125, 386425, 393125, 403325, 408850, 416585, 430625, 435625, 453050, 456025, 469625, 471250, 491725, 493025, 495625, 499525, 505325
Offset: 1

Views

Author

Keywords

Comments

Sequences A025320 and A025301 are different. 2*5^18 = 7629394531250 = 182125^2 + 2756125^2 = 390625^2 + 2734375^2 = 596875^2 + 2696875^2 = 799687^2 + 2643841^2 = 946555^2 + 2594885^2 = 1140625^2 + 2515625^2 = 1328125^2 + 2421875^2 = 1507975^2 + 2314175^2 = 1799375^2 + 2095625^2 = 1953125^2 + 1953125^2 (not distinct squares) is not in A025320. - Vaclav Kotesovec, Feb 27 2016
Numbers in A025301 but not in A025320 are exactly those numbers of the form 2*p_1^(2*a_1)*p_2^(2*a_2)*...*p_m^(2*a_m)*q^18 where p_i are primes of the form 4k+3 and q is a prime of the form 4k+1. Thus 2*5^18 is the smallest term in A025301 that is not in A025320. - Chai Wah Wu, Feb 27 2016

Crossrefs

Programs

  • Mathematica
    nn = 505325; t = Table[0, {nn}]; lim = Floor[Sqrt[nn - 1]]; Do[num = i^2 + j^2; If[num <= nn, t[[num]]++], {i, lim}, {j, i}]; Flatten[Position[t, ?(# >= 10 &)]] (* _T. D. Noe, Apr 07 2011 *)

A155469 Numbers that are the sum of 2 (not-distinct) numbers; nonzero square and cube, including repetitions.

Original entry on oeis.org

2, 5, 9, 10, 12, 17, 17, 24, 26, 28, 31, 33, 36, 37, 43, 44, 50, 52, 57, 63, 65, 65, 68, 72, 73, 76, 80, 82, 89, 89, 91, 100, 101, 108, 108, 113, 122, 126, 127, 128, 129, 129, 134, 141, 145, 145, 148, 150, 152, 161, 164, 170, 171, 174, 177, 185, 189, 196, 197, 204
Offset: 1

Views

Author

Keywords

Comments

5=2^2+1^3, 12=2^2+2^3, 17=3^2+2^3, 31=2^2+3^3, 43=4^2+3^3, 65=1^2+4^3, 65=8^2+1^3, 100=6^2+4^3, ...

Crossrefs

Programs

  • Mathematica
    lst={};Do[Do[Do[a=x^2+y^3;If[a>n,Break[]];If[a==n,AppendTo[lst,n]],{y,5!}],{x,5!}],{n,4*5!}];lst

A155470 Numbers that are the sum of 2 numbers; nonzero square and cube, including repetitions, squareNumber <> cubeNumber.

Original entry on oeis.org

5, 9, 10, 17, 17, 24, 26, 28, 31, 33, 37, 43, 44, 50, 52, 57, 63, 65, 65, 68, 72, 73, 76, 82, 89, 89, 91, 100, 101, 108, 108, 113, 122, 126, 127, 128, 129, 129, 134, 141, 145, 145, 148, 152, 161, 164, 170, 171, 174, 177, 185, 189, 196, 197, 204, 206, 208, 217, 220
Offset: 1

Views

Author

Keywords

Comments

17=3^2+2^3, 17=4^2+1^3, 31=2^2+3^3, 43=4^2+3^3, 65=1^2+4^3, 65=8^2+1^3, 100=6^2+4^3, ...

Crossrefs

Programs

  • Mathematica
    lst={};Do[Do[Do[If[x!=y,a=x^2+y^3;If[a>n,Break[]];If[a==n,AppendTo[lst,n]]],{y,5!}],{x,5!}],{n,4*5!}];lst

A155472 Numbers that are the sum of 2 (not-distinct) numbers; nonzero power3 and power5, including repetitions.

Original entry on oeis.org

2, 9, 28, 33, 40, 59, 65, 96, 126, 157, 217, 244, 248, 251, 270, 307, 344, 368, 375, 459, 513, 544, 586, 730, 755, 761, 972, 1001, 1025, 1032, 1032, 1051, 1088, 1149, 1240, 1243, 1332, 1363, 1367, 1536, 1574, 1729, 1753, 1760, 1971, 2024, 2198, 2229, 2355
Offset: 1

Views

Author

Keywords

Comments

40=2^3+2^5, 1032=2^3+4^5 = 1032=10^3+2^5, 1971=12^3+3^5, ...

Crossrefs

Programs

  • Mathematica
    lst={};Do[Do[Do[a=x^3+y^5;If[a>n,Break[]];If[a==n,AppendTo[lst,n]],{y,5!}],{x,5!}],{n,7!}];lst

A173256 Partial sums of A001481.

Original entry on oeis.org

0, 1, 3, 7, 12, 20, 29, 39, 52, 68, 85, 103, 123, 148, 174, 203, 235, 269, 305, 342, 382, 423, 468, 517, 567, 619, 672, 730, 791, 855, 920, 988, 1060, 1133, 1207, 1287, 1368, 1450, 1535, 1624, 1714, 1811, 1909, 2009, 2110, 2214, 2320, 2429, 2542, 2658, 2775
Offset: 1

Views

Author

Jonathan Vos Post, Feb 14 2010

Keywords

Comments

The subsequence of primes in this sequence begins 3, 7, 29, 103, 269, 619, 1811, 3271.

Examples

			a(66) = 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 + 52 + 53 + 58 + 61 + 64 + 65 + 68 + 72 + 73 + 74 + 80 + 81 + 82 + 85 + 89 + 90 + 97 + 98 + 100 + 101 + 104 + 106 + 109 + 113 + 116 + 117 + 121 + 122 + 125 + 128 + 130 + 136 + 137 + 144 + 145 + 146 + 148 + 149 + 153 + 157 + 160 = 4876.
		

Crossrefs

Programs

  • Maple
    N:= 1000:
    A001481:= sort(convert({seq(seq(x^2+y^2, y=0..floor(sqrt(N-x^2))),x=0..floor(sqrt(N)))},list)):
    ListTools:-PartialSums(A001481); # Robert Israel, Mar 15 2016
  • Python
    from itertools import count, accumulate, islice
    from sympy import factorint
    def A173256_gen(): # generator of terms
        return accumulate(filter(lambda n:all(p & 3 != 3 or e & 1 == 0 for p, e in factorint(n).items()),count(0)))
    A173256_list = list(islice(A173256_gen(),30)) # Chai Wah Wu, Jun 27 2022

Formula

a(n) = Sum_{i=1..n} A001481(i) = Sum_{i=1..n} (numbers that are the sum of 2 nonnegative squares) = Sum_{i=1..n} (numbers n such that i = x^2 + y^2 has a solution in nonnegative integers x, y).

Extensions

a(21) corrected by Robert Israel, Mar 15 2016

A379925 Numbers k for which nonnegative integers x and y exist such that x^2 + y^2 = k and x + y is a square.

Original entry on oeis.org

0, 1, 8, 10, 16, 41, 45, 53, 65, 81, 128, 130, 136, 146, 160, 178, 200, 226, 256, 313, 317, 325, 337, 353, 373, 397, 425, 457, 493, 533, 577, 625, 648, 650, 656, 666, 680, 698, 720, 746, 776, 810, 848, 890, 936, 986, 1040, 1098, 1160, 1201, 1205, 1213, 1225, 1226
Offset: 1

Views

Author

Felix Huber, Jan 25 2025

Keywords

Comments

Numbers k for which exists at least one solution to k = x^2 + (z^2 - x)^2 in integers x and z with x >= 0 and z >= sqrt(2*x).
Subsequence of A001481.

Examples

			10 is in the sequence because 10 = 1^2 + 3^2 and 1 + 3 = 2^2.
81 is in the sequence because 81 = 0^2 + 9^2 and 0 + 9 = 3^2.
		

Crossrefs

Programs

  • Maple
    # Calculates the first 10005 terms.
    A379925:=proc(K)
        local i,j,L;
        L:={};
        for i from 0 to floor(sqrt((K+1)^2)/2) do
            for j from 0 to floor(sqrt((K+1)^2/2-i^2)) do
                if issqr(i+j) then
                    L:=L union {i^2+j^2}
                fi
            od
        od;
        return op(L)
    end proc;
    A379925(1737);
  • PARI
    isok(n)=my(x=0, r=0); while(x<=sqrt(n) && r==0, if(issquare(n-x^2) && issquare(x+sqrtint(n-x^2)), r=1); x++); r; \\ Michel Marcus, Feb 10 2025

Formula

k = m^(4*j) is in the sequence for nonnegative integers m and j (not both 0) because x = 0 and z = m^j is a solution to m^(4*j) = x^2 + (z^2 - x)^2.

A155473 Numbers of the form x^3+y^5, with x,y>0 and x<>y.

Original entry on oeis.org

9, 28, 33, 59, 65, 96, 126, 157, 217, 244, 248, 251, 307, 344, 368, 375, 459, 513, 544, 586, 730, 755, 761, 972, 1001, 1025, 1032, 1032, 1051, 1149, 1240, 1243, 1332, 1363, 1367, 1536, 1574, 1729, 1753, 1760, 1971, 2024, 2198, 2229, 2355, 2440, 2745, 2752
Offset: 1

Views

Author

Keywords

Comments

Numbers with more than one of these representations are repeated for each of them.
This concerns 1032 = 2^3+4^5 = 10^3+2^5 or 9504 = 12^3+6^5 = 21^3+3^5, for example (see A035046).

Examples

			59=3^3+2^5, 157=5^3+2^5, 513=8^3+1^5, 586=7^3+3^5, ...
		

Crossrefs

Programs

  • Mathematica
    lst={};Do[Do[Do[If[x!=y,a=x^3+y^5;If[a>n,Break[]];If[a==n,AppendTo[lst,n]]],{y,5!}],{x,5!}],{n,7!}];lst

Extensions

Edited by R. J. Mathar, Mar 02 2009
Showing 1-8 of 8 results.