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-10 of 15 results. Next

A000404 Numbers that are the sum of 2 nonzero squares.

Original entry on oeis.org

2, 5, 8, 10, 13, 17, 18, 20, 25, 26, 29, 32, 34, 37, 40, 41, 45, 50, 52, 53, 58, 61, 65, 68, 72, 73, 74, 80, 82, 85, 89, 90, 97, 98, 100, 101, 104, 106, 109, 113, 116, 117, 122, 125, 128, 130, 136, 137, 145, 146, 148, 149, 153, 157, 160, 162, 164, 169, 170, 173, 178
Offset: 1

Views

Author

Keywords

Comments

From the formula it is easy to see that if k is in this sequence, then so are all odd powers of k. - T. D. Noe, Jan 13 2009
Also numbers whose cubes are the sum of two nonzero squares. - Joe Namnath and Lawrence Sze
A line perpendicular to y=mx has its first integral y-intercept at a^2+b^2. The remaining ones for that slope are multiples of that primitive value. - Larry J Zimmermann, Aug 19 2010
The primes in this sequence are sequence A002313.
Complement of A018825; A025426(a(n)) > 0; A063725(a(n)) > 0. - Reinhard Zumkeller, Aug 16 2011
If the two squares are not equal, then any power is still in the sequence: if k = x^2 + y^2 with x != y, then k^2 = (x^2-y^2)^2 + (2xy)^2 and k^3 = (x(x^2-3y^2))^2 + (y(3x^2-y^2))^2, etc. - Carmine Suriano, Jul 13 2012
There are never more than 3 consecutive terms that differ by 1. Triples of consecutive terms that differ by 1 occur infinitely many times, for example, 2(k^2 + k)^2, (k^2 - 1)^2 + (k^2 + 2 k)^2, and (k^2 + k - 1)^2 + (k^2 + k + 1)^2 for any integer k > 1. - Ivan Neretin, Mar 16 2017 [Corrected by Jerzy R Borysowicz, Apr 14 2017]
Number of terms less than 10^k, k=1,2,3,...: 3, 34, 308, 2690, 23873, 215907, 1984228, ... - Muniru A Asiru, Feb 01 2018
The squares in this sequence are the squares of the so-called hypotenuse numbers A009003. - M. F. Hasler, Jun 20 2025

Examples

			25 = 3^2 + 4^2, therefore 25 is a term. Note that also 25^3 = 15625 = 44^2 + 117^2, therefore 15625 is a term.
		

References

  • David A. Cox, "Primes of the Form x^2 + n y^2", Wiley, 1989.
  • GCHQ, The GCHQ Puzzle Book, Penguin, 2016. See page 103.
  • E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985, p. 75, Theorem 4, with Theorem 2, p. 15.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, p. 219, th. 251, 252.
  • Ian Stewart, "Game, Set and Math", Chapter 8, 'Close Encounters of the Fermat Kind', Penguin Books, Ed. 1991, pp. 107-124.

Crossrefs

A001481 gives another version (allowing for zero squares).
Cf. A004431 (2 distinct squares), A063725 (number of representations), A024509 (numbers with multiplicity), A025284, A018825. Also A050803, A050801, A001105, A033431, A084888, A000578, A000290, A057961, A232499, A007692.
Cf. A003325 (analog for cubes), A003336 (analog for 4th powers).
Cf. A009003 (square roots of the squares in this sequence).
Column k=2 of A336725.

Programs

  • GAP
    P:=List([1..10^4],i->i^2);;
    A000404 := Set(Flat(List(P, i->List(P, j -> i+j)))); # Muniru A Asiru, Feb 01 2018
    
  • Haskell
    import Data.List (findIndices)
    a000404 n = a000404_list !! (n-1)
    a000404_list = findIndices (> 0) a025426_list
    -- Reinhard Zumkeller, Aug 16 2011
    
  • Magma
    lst:=[]; for n in [1..178] do f:=Factorization(n); if IsSquare(n) then for m in [1..#f] do d:=f[m]; if d[1] mod 4 eq 1 then Append(~lst, n); break; end if; end for; else t:=0; for m in [1..#f] do d:=f[m]; if d[1] mod 4 eq 3 and d[2] mod 2 eq 1 then t:=1; break; end if; end for; if t eq 0 then Append(~lst, n); end if; end if; end for; lst; // Arkadiusz Wesolowski, Feb 16 2017
    
  • Maple
    nMax:=178: A:={}: for i to floor(sqrt(nMax)) do for j to floor(sqrt(nMax)) do if i^2+j^2 <= nMax then A := `union`(A, {i^2+j^2}) else  end if end do end do: A; # Emeric Deutsch, Jan 02 2017
  • Mathematica
    nMax=1000; n2=Floor[Sqrt[nMax-1]]; Union[Flatten[Table[a^2+b^2, {a,n2}, {b,a,Floor[Sqrt[nMax-a^2]]}]]]
    Select[Range@ 200, Length[PowersRepresentations[#, 2, 2] /. {0, } -> Nothing] > 0 &] (* _Michael De Vlieger, Mar 24 2016 *)
    Module[{upto=200},Select[Union[Total/@Tuples[Range[Sqrt[upto]]^2,2]],#<= upto&]] (* Harvey P. Dale, Sep 18 2021 *)
  • PARI
    is_A000404(n)= for( i=1,#n=factor(n)~%4, n[1,i]==3 && n[2,i]%2 && return); n && ( vecmin(n[1,])==1 || (n[1,1]==2 && n[2,1]%2)) \\ M. F. Hasler, Feb 07 2009
    
  • PARI
    list(lim)=my(v=List(),x2); lim\=1; for(x=1,sqrtint(lim-1), x2=x^2; for(y=1,sqrtint(lim-x2), listput(v,x2+y^2))); Set(v) \\ Charles R Greathouse IV, Apr 30 2016
    
  • Python
    from itertools import count, islice
    from sympy import factorint
    def A000404_gen(startvalue=1): # generator of terms >= startvalue
        for n in count(max(startvalue,1)):
            c = False
            for p in (f:=factorint(n)):
                if (q:= p & 3)==3 and f[p]&1:
                    break
                elif q == 1:
                    c = True
            else:
                if c or f.get(2,0)&1:
                    yield n
    A000404_list = list(islice(A000404_gen(),30)) # Chai Wah Wu, Jul 01 2022

Formula

Let k = 2^t * p_1^a_1 * p_2^a_2 * ... * p_r^a_r * q_1^b_1 * q_2^b_2 * ... * q_s^b_s with t >= 0, a_i >= 0 for i=1..r, where p_i == 1 (mod 4) for i=1..r and q_j == -1 (mod 4) for j=1..s. Then k is a term iff 1) b_j == 0 (mod 2) for j=1..s and 2) r > 0 or t == 1 (mod 2) (or both).
From Charles R Greathouse IV, Nov 18 2022: (Start)
a(n) ~ k*n*sqrt(log n), where k = 1.3085... = 1/A064533.
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. (End)

Extensions

Edited by Ralf Stephan, Nov 15 2004
Typo in formula corrected by M. F. Hasler, Feb 07 2009
Erroneous Mathematica program fixed by T. D. Noe, Aug 07 2009
PARI code fixed for versions > 2.5 by M. F. Hasler, Jan 01 2013

A050801 Numbers k such that k^2 is expressible as the sum of two positive cubes in at least one way.

Original entry on oeis.org

3, 4, 24, 32, 81, 98, 108, 168, 192, 228, 256, 312, 375, 500, 525, 588, 648, 671, 784, 847, 864, 1014, 1029, 1183, 1225, 1261, 1323, 1344, 1372, 1536, 1824, 2048, 2187, 2496, 2646, 2888, 2916, 3000, 3993, 4000, 4200, 4225, 4536, 4563, 4644, 4704, 5184, 5324
Offset: 1

Views

Author

Patrick De Geest, Sep 15 1999

Keywords

Comments

Analogous solutions exist for the sum of two identical cubes z^2 = 2*r^3 (e.g., 864^2 = 2*72^3). Values of 'z' are the terms in A033430, values of 'r' are the terms in A001105.
First term whose square can be expressed in two ways is 77976; 77976^2 = 228^3 + 1824^3 = 1026^3 + 1710^3. - Jud McCranie
First term whose square can be expressed in three ways is 3343221000; 3343221000^2 = 279300^3 + 2234400^3 = 790020^3 + 2202480^3 = 1256850^3 + 2094750^3.
First term whose square can be expressed in four ways <= 42794271007595289; 42794271007595289^2 = 14385864402^3 + 122279847417^3 = 55172161278^3 + 118485773289^3 = 64117642953^3 + 116169722214^3 = 96704977369^3 + 97504192058^3.
First term whose square can be expressed in five ways <= 47155572445935012696000; 47155572445935012696000^2 = 94405759361550^3 + 1305070263601650^3 = 374224408544280^3 + 1294899176535720^3 = 727959282778000^3 + 1224915311765600^3 = 857010857812200^3 + 1168192425418200^3 = 1009237516560000^3 + 1061381454915600^3.
After a(1) = 3 this is always composite, because factorization of the polynomial a^3 + b^3 into irreducible components over Z is a^3 + b^3 = (b+a)*(b^2 - ab + b^2). They may be semiprimes, as with 671 = 11 * 61, and 1261 = 13 * 97. The numbers can be powers in various ways, as with 32 = 2^5, 81 = 3^4, 256 = 2^8, 784 = 2^4 * 7^2 , 1225 = 5^2 * 7^2, and 2187 = 3^7. - Jonathan Vos Post, Feb 05 2011
If n is a term then n*b^3 is also a term for any b, e.g., 3 is a term hence 3*2^3 = 24, 3*3^3 = 81 and also 3*4^3 = 192 are terms. Sequence of primitive terms may be of interest. - Zak Seidov, Dec 11 2013
First noncubefree primitive term is 168 = 21*2^3 (21 is not a term of the sequence). - Zak Seidov, Dec 16 2013
From XU Pingya, Apr 10 2021: (Start)
Every triple (a, b, c) (with a^2 = b^3 + c^3) can produce a nontrivial parametric solution (x, y, z) of the Diophantine equation x^2 + y^3 + z^3 = d^4.
For example, to (1183, 65, 104), there is such a solution (d^2 - (26968032*d)*t^3 + 1183*8232^3*t^6, (376*d)*t - 65*8232^2*t^4, (92*d)*t - 104*8232^2*t^4).
To (77976, 228, 1824), there is (d^2 - (272916*d)*t^3 + 77976*57^3*t^6, (52*d)*t - 228*57^2*t^4, (74*d)*t - 1824*57^2*t^4).
Or to (77976, 1026, 1719), there is (d^2 - (25992*d)*t^3 + 77976*19^3*t^6, (37*d)*t - 1026*19^2*t^4, (11*d)*t - 1710*19^2*t^4). (End)

Examples

			1183^2 = 65^3 + 104^3.
		

References

  • Ian Stewart, "Game, Set and Math", Chapter 8, 'Close Encounters of the Fermat Kind', Penguin Books, Ed. 1991, pp. 107-124.

Crossrefs

Programs

  • Maple
    A050801 := proc(n)
        option remember ;
        local a,x,y ;
        if n =1 then
            3
        else
            for a from procname(n-1)+1 do
                for x from 1 do
                    if x^3 >= a^2 then
                        break ;
                    end if;
                    for y from 1 to x do
                        if x^3+y^3 = a^2 then
                            return a ;
                        end if;
                    end do:
                end do:
            end do:
        end if;
    end proc:
    seq(A050801(n),n=1..20) ; # R. J. Mathar, Jan 22 2025
  • Mathematica
    Select[Range[5350], Reduce[0 < x <= y && #^2 == x^3 + y^3, {x,y}, Integers] =!= False &] (* Jean-François Alcover, Mar 30 2011 *)
    Sqrt[#]&/@Union[Select[Total/@(Tuples[Range[500],2]^3),IntegerQ[ Sqrt[ #]]&]] (* Harvey P. Dale, Mar 06 2012 *)
    Select[Range@ 5400, Length@ DeleteCases[PowersRepresentations[#^2, 2, 3], w_ /; Times @@ w == 0] > 0 &] (* Michael De Vlieger, May 20 2017 *)
  • PARI
    is(n)=my(N=n^2); for(k=sqrtnint(N\2,3),sqrtnint(N-1,3), if(ispower(N-k^3,3), return(n>1))); 0 \\ Charles R Greathouse IV, Dec 13 2013

Formula

a(n) = sqrt(A050802(n)). - Jonathan Sondow, Oct 28 2013

Extensions

More terms from Michel ten Voorde and Jud McCranie

A135786 a(n) = A000404(n)^4.

Original entry on oeis.org

16, 625, 4096, 10000, 28561, 83521, 104976, 160000, 390625, 456976, 707281, 1048576, 1336336, 1874161, 2560000, 2825761, 4100625, 6250000, 7311616, 7890481, 11316496, 13845841, 17850625, 21381376, 26873856, 28398241, 29986576
Offset: 1

Views

Author

Artur Jasinski, Nov 29 2007

Keywords

Crossrefs

Programs

  • Mathematica
    nMax = 100; p := Floor[Sqrt[nMax - 1]]; Union[Flatten[Table[a^2 + b^2, {a, p}, {b, a, Floor[Sqrt[nMax - a^2]]}]]]^4 (* G. C. Greubel, Nov 09 2016 *)

Extensions

Definition corrected by Zak Seidov, Aug 05 2009

A135787 a(n) = A000404(n)^5.

Original entry on oeis.org

32, 3125, 32768, 100000, 371293, 1419857, 1889568, 3200000, 9765625, 11881376, 20511149, 33554432, 45435424, 69343957, 102400000, 115856201, 184528125, 312500000, 380204032, 418195493, 656356768, 844596301, 1160290625
Offset: 1

Views

Author

Artur Jasinski, Nov 29 2007

Keywords

Crossrefs

Programs

  • Mathematica
    nMax = 100; p := Floor[Sqrt[nMax - 1]]; Union[Flatten[Table[a^2 + b^2, {a, p}, {b, a, Floor[Sqrt[nMax - a^2]]}]]]^5 (* G. C. Greubel, Nov 09 2016 *)

A135789 Positive numbers of the form x^4 - 6 * x^2 * y^2 + y^4 (where x,y are integers).

Original entry on oeis.org

28, 41, 161, 448, 476, 656, 721, 956, 1081, 1241, 1393, 2108, 2268, 2576, 3281, 3321, 3713, 3836, 4633, 4681, 5593, 6076, 7168, 7616, 8188, 9401, 9641, 10496, 11536, 11753, 12121, 12593, 13041, 13916, 15296, 16828, 17296, 17500, 19516, 19856
Offset: 1

Views

Author

Artur Jasinski, Nov 29 2007, Nov 14 2008

Keywords

Comments

Squares of these numbers are of the form N^4 - M^2 (where N belongs to A135786 and M to A057102). Proof is based on the identity (x^4 - 6x^2 * y^2 + y^4)^2 = (x^2 + y^2)^4 - (4(x^3y - xy^3))^2.
Since x^4 - 6x^2 * y^2 + y^4 = d*d' where d = x^2 - y^2 + 2xy and d' = x^2 - y^2 - 2xy, and d - d' = 4xy, the computational technique is to consider the divisors d|n, d'=n/d, to check that the difference is a multiple of 4, and to check x in the range 1..d/3. - R. J. Mathar, Sep 18 2009
Refers to A057102, which had an incorrect description and has been replaced by A256418. As a result the present sequence should be re-checked. - N. J. A. Sloane, Apr 06 2015

Crossrefs

Programs

  • Maple
    isA135789 := proc(n) for d in numtheory[divisors](n) do dprime := n/d ; if abs(d-dprime) mod 4 = 0 then for x from 1 to d/3 do y := (d-dprime)/4/x ; if type(y,'integer') and y< x and y> 0 then if n = (x^2-y^2+2*x*y)*(x^2-y^2-2*x*y) then RETURN(true); fi; fi; od: fi: od: RETURN(false) ; end: for n from 1 do if isA135789(n) then printf("%d,\n",n) ; fi; od: # R. J. Mathar, Sep 18 2009
  • Mathematica
    a = {}; Do[Do[w = x^4 - 6x^2 y^2 + y^4; If[w > 0&&w<10000, AppendTo[a, w]], {x, y, 2000}], {y, 1, 2000}]; Union[a]

Extensions

More terms from R. J. Mathar, Sep 18 2009

A050802 Squares expressible as the sum of two positive cubes in at least one way.

Original entry on oeis.org

9, 16, 576, 1024, 6561, 9604, 11664, 28224, 36864, 51984, 65536, 97344, 140625, 250000, 275625, 345744, 419904, 450241, 614656, 717409, 746496, 1028196, 1058841, 1399489, 1500625, 1590121, 1750329, 1806336, 1882384, 2359296
Offset: 1

Views

Author

Patrick De Geest, Sep 15 1999

Keywords

Examples

			E.g., 717409 = 847^2 = 33^3 + 88^3.
169 = 13^2 = (-7)^3 + 8^3 is not a member, because 169 is not the sum of two positive cubes. - _Jonathan Sondow_, Oct 28 2013
		

References

  • "Game, Set and Math" by Ian Stewart, Chapter 8 'Close Encounters of the Fermat Kind', Penguin Books, Ed. 1991, pp. 107-124.

Crossrefs

Programs

  • Mathematica
    ok[n_] := Length[Select[PowersRepresentations[n, 2, 3], #[[1]] != 0 & ]] >= 1; Select[Range[1600]^2, ok]
    (* Jean-François Alcover, Apr 22 2011 *)
    Union[Select[Total/@Tuples[Range[250]^3,2],IntegerQ[Sqrt[#]]&]] (* Harvey P. Dale, Mar 04 2012 *)
  • PARI
    { nstart=1; a2start=9; n=nstart; a=sqrtint(a2start)-1; until (0, a=a+1; a2=a*a; b1=((a2/2)^(1/3))\1; for (b=b1, a, b3=b*b*b; c1=1; if (a2 > b3, c1=((a2-b3)^(1/3))\1;); for (c=c1, b, d=b3 + c*c*c; if (d > a2 && c == 1, break(2)); if (d > a2, break); if (a2 == d, print(n, " ", a2); write("b050802.txt", n, " ", a2); n=n+1; break(2); ); ) ) ) } \\ Harry J. Smith, Jan 15 2009
    
  • PARI
    is(n)=for(k=sqrtnint((n+1)\2,3),sqrtnint(n-1,3),if(ispower(n-k^3,3),return(issquare(n))));0 \\ Charles R Greathouse IV, Oct 28 2013

Formula

a(n) = A050801(n)^2. - Jonathan Sondow, Oct 28 2013

Extensions

More terms from Michel ten Voorde
Definition corrected by Jonathan Sondow, Oct 28 2013

A135790 Positive numbers of the form -x^4+6x^2 y^2-y^4 (where x,y are integers).

Original entry on oeis.org

4, 7, 64, 112, 119, 164, 239, 324, 527, 567, 644, 959, 1024, 1519, 1792, 1904, 2047, 2500, 2624, 2884, 3479, 3824, 4207, 4324, 4375, 4879, 4964, 5184, 5572, 6647, 6887, 7327, 8119, 8432, 9072, 9604, 9639
Offset: 1

Views

Author

Artur Jasinski, Nov 29 2007

Keywords

Comments

Squares of these numbers are of the form N^4-M^2 (where N belongs to A135786 and M to A057102). Proof uses: (x^4 - 6x^2 y^2 + y^4)^2=(x^2+y^2)^4-(4(x^3y-xy^2))^2.
Refers to A057102, which had an incorrect description and has been replaced by A256418. As a result the present sequence should be re-checked. - N. J. A. Sloane, Apr 06 2015

Crossrefs

Programs

  • Mathematica
    a = {}; Do[Do[w = -x^4 + 6x^2 y^2 - y^4; If[w > 0&&w<10000, AppendTo[a, w]], {x, y, 2000}], {y, 1, 2000}]; Union[a]

A135791 Positive numbers of the form x^5-10x^3*y^2+5x*y^4 (where x,y are integers and x>y).

Original entry on oeis.org

404, 1900, 3647, 5646, 12928, 13412, 14050, 27688, 30609, 36413, 45716, 51804, 60800, 74576, 90050, 98172
Offset: 1

Views

Author

Artur Jasinski, Nov 29 2007

Keywords

Comments

See A135792, union A135791 and A135792 see A135793. Squares of these numbers are of the form N^5-M^2 (where N belongs to A135787 and M to A057102) Proof uses: (x^5-10x^3 y^2+5xy^4)^2=(x^2+y^2)^5-(5x^4y-10x^2y^3+y^5)^2. [This line needs editing! - N. J. A. Sloane, Dec 04 2007]
Refers to A057102, which had an incorrect description and has been replaced by A256418. As a result the present sequence should be re-checked. - N. J. A. Sloane, Apr 06 2015

Crossrefs

Programs

  • Mathematica
    a = {}; Do[Do[w = x^5 - 10x^3 y^2 + 5x y^4; If[w > 0 && w < 100000, AppendTo[a, w]], {x, y, 1000}], {y, 1, 1000}]; Union[a]

A135788 a(n) = A000404(n)^6.

Original entry on oeis.org

64, 15625, 262144, 1000000, 4826809, 24137569, 34012224, 64000000, 244140625, 308915776, 594823321, 1073741824, 1544804416, 2565726409, 4096000000, 4750104241, 8303765625, 15625000000, 19770609664, 22164361129, 38068692544
Offset: 1

Views

Author

Artur Jasinski, Nov 29 2007

Keywords

Crossrefs

Programs

  • Mathematica
    nMax = 100; p := Floor[Sqrt[nMax - 1]]; Union[Flatten[Table[a^2 + b^2, {a, p}, {b, a, Floor[Sqrt[nMax - a^2]]}]]]^6 (* G. C. Greubel, Nov 09 2016 *)

A135792 Positive numbers of the form x^5-10x^3*y^2+5x*y^4 (where x,y are integers and y>x).

Original entry on oeis.org

41, 122, 316, 1121, 1312, 1900, 2868, 2876, 3904, 4282, 6121, 9963, 10112, 11516, 17684, 19841, 20122, 23028, 23807, 25525, 29646, 31996, 35872, 41984, 44403, 49001, 59162, 60800, 65900, 71996, 76453, 76788, 80404, 91776, 92032
Offset: 1

Views

Author

Artur Jasinski, Nov 29 2007

Keywords

Comments

Refers to A057102, which had an incorrect description and has been replaced by A256418. As a result the present sequence should be re-checked. - N. J. A. Sloane, Apr 06 2015

Crossrefs

Programs

  • Mathematica
    a = {}; Do[Do[w = x^5 - 10x^3 y^2 + 5x y^4; If[w > 0 && w < 100000, AppendTo[a, w]], {y, x, 1000}], {x, 1, 1000}]; Union[a]
Showing 1-10 of 15 results. Next