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 11 results. Next

A000164 Number of partitions of n into 3 squares (allowing part zero).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 0, 1, 2, 1, 1, 1, 1, 1, 0, 1, 2, 2, 1, 1, 1, 1, 0, 1, 2, 2, 2, 0, 2, 1, 0, 1, 2, 2, 1, 2, 1, 2, 0, 1, 3, 1, 1, 1, 2, 1, 0, 1, 2, 3, 2, 1, 2, 3, 0, 1, 2, 1, 2, 0, 2, 2, 0, 1, 3, 3, 1, 2, 2, 1, 0, 2, 2, 3, 2, 1, 2, 1, 0, 1, 4, 2, 2, 1, 2, 3, 0, 1, 4, 3, 1, 0, 1, 2, 0, 1, 2, 3, 3, 2, 4, 2, 0, 2
Offset: 0

Views

Author

Keywords

Comments

a(n) = number of triples of integers [ i, j, k] such that i >= j >= k >= 0 and n = i^2 + j^2 + k^2. - Michael Somos, Jun 05 2012

Examples

			G.f. = 1 + x + x^2 + x^3 + x^4 + x^5 + x^6 + x^8 + 2*x^9 + x^10 + x^11 + x^12 + x^13 + ...
		

References

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

Crossrefs

Equivalent sequences for other numbers of squares: A000161 (2), A002635 (4), A000174 (5).
Cf. A004215 (positions of zeros), A094942 (positions of ones), A124966 (positions of greater values).

Programs

  • Maple
    A000164 := proc(n)
        local a,x,y,z2,z ;
        a := 0 ;
        for x from 0 do
            if 3*x^2 > n then
                return a;
            end if;
            for y from x do
                if x^2+2*y^2 > n then
                    break;
                end if;
                z2 := n-x^2-y^2 ;
                if issqr(z2) then
                    z := sqrt(z2) ;
                    if z >= y then
                        a := a+1 ;
                    end if;
                end if;
            end do:
        end do:
        a;
    end proc: # R. J. Mathar, Feb 12 2017
  • Mathematica
    Length[PowersRepresentations[ #, 3, 2]] & /@ Range[0, 104]
    e[0,r_,s_,m_]=0;e[n_,r_,s_,m_]:=Length[Select[Divisors[n],Mod[ #,m]==r &]]-Length[Select[Divisors[n],Mod[ #,m]==s &]];alpha[n_]:=5delta[n]+3delta[1/2 n]+4delta[1/3n];beta[n_]:=4e[n,1,3,4]+3e[n,1,7,8]+3e[n,3,5,8];delta[n_]:=If[IntegerQ[Sqrt[n]],1,0];f[n_]:=Table[n-k^2, {k,1,Floor[Sqrt[n]]}]; gamma[n_]:=2 Plus@@(e[ #,1,3,4] &/@f[n]);p3[n_]:=1/12(alpha[n]+beta[n]+gamma[n]);p3[ # ] &/@Range[0,104]
    (* Ant King, Oct 15 2010 *)
    a[ n_] := If[ n < 0, 0, Sum[ Boole[ n == i^2 + j^2 + k^2], {i, 0, Sqrt[n]}, {j, 0, i}, {k, 0, j}]]; (* Michael Somos, Aug 15 2015 *)
  • PARI
    {a(n) = if( n<0, 0, sum( i=0, sqrtint(n), sum( j=0, i, sum( k=0, j, n == i^2 + j^2 + k^2))))}; /* Michael Somos, Jun 05 2012 */
    
  • Python
    import collections; a = collections.Counter(i*i + j*j + k*k for i in range(100) for j in range(i+1) for k in range(j+1)) # David Radcliffe, Apr 15 2019

Formula

Let e(n,r,s,m) be the excess of the number of n's r(mod m) divisors over the number of its s (mod m) divisors, and let delta(n)=1 if n is a perfect square and 0 otherwise. Then, if we define alpha(n) = 5*delta(n) + 3*delta(n/2) + 4*delta(n/3), beta(n) = 4*e(n,1,3,4) + 3*e(n,1,7,8) + 3*e(n,3,5,8), gamma(n) = 2*Sum_{1<=k^2Ant King, Oct 15 2010

Extensions

Name clarified by Wolfdieter Lang, Apr 08 2013

A124967 Numbers which can be expressed as the ordered sum of 3 squares in 3 or more different ways.

Original entry on oeis.org

41, 50, 54, 65, 66, 74, 81, 86, 89, 90, 98, 99, 101, 110, 113, 114, 117, 121, 122, 125, 126, 129, 131, 134, 137, 145, 146, 149, 150, 153, 161, 162, 164, 166, 169, 170, 171, 173, 174, 178, 179, 181, 182, 185, 186, 189, 194, 197, 198, 200, 201, 205, 206, 209
Offset: 1

Views

Author

Artur Jasinski, Nov 14 2006

Keywords

Examples

			a(1) = 41 because 41 = 4^2+4^2+3^2 or 5^2+4^2+0^2 or 6^2+2^2+1^2.
117=0^2+6^2+9^2=1^2+4^2+10^2=2^2+7^2+8^2, so 117 is in the list.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0, 1, `if`(t*i^23, 3, min(3, b(n, i-1, t)+
          `if`(i^2>n, 0, b(n-i^2, i, t-1))))))
        end:
    a:= proc(n) option remember; local k;
          for k from 1 +`if`(n=1, 0, a(n-1))
          while b(k, isqrt(k), 3)<3 do od; k
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Apr 10 2013
  • Mathematica
    Select[Range[210], Length@PowersRepresentations[#, 3, 2] >= 3 &] (* Ray Chandler, Oct 31 2019 *)
  • PARI
    isA124967(n)={ local(cnt=0,z2) ; for(x=0,floor(sqrt(n)), for(y=x,floor(sqrt(n-x^2)), z2=n-x^2-y^2 ; if( z2>=y^2 && issquare(z2), cnt++ ; ) ; if(cnt >=3, return(1) ) ; ) ; ) ; return(0) ; } { for(n=1,200, if( isA124967(n), print1(n,", ") ; ) ; ) ; } (Mathar)

Extensions

Corrected and extended by Ray Chandler and R. J. Mathar, Nov 29 2006

A124968 Numbers which can be expressed as the ordered sum of 3 squares in 4 or more different ways.

Original entry on oeis.org

81, 89, 101, 125, 129, 134, 146, 149, 153, 161, 162, 170, 171, 173, 185, 189, 194, 198, 201, 206, 209, 221, 225, 230, 233, 234, 241, 242, 243, 245, 246, 249, 250, 251, 254, 257, 261, 266, 269, 270, 274, 278, 281, 285, 289, 290, 293, 294, 297, 299, 305, 306
Offset: 1

Views

Author

Artur Jasinski, Nov 14 2006

Keywords

Comments

Subset of A124967.

Examples

			a(1)=81 because 81 = 6^2 + 6^2 + 3^2 = 7^2 + 4^2 + 4^2 = 8^2 + 4^2 + 1^2 = 9^2 + 0^2 + 0^2.
161 = 1^2 + 4^2 + 12^2 = 2^2 + 6^2 + 11^2 = 4^2 + 8^2 + 9^2 = 5^2 + 6^2 + 10^2, so 161 is in the list.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[310], Length@PowersRepresentations[#, 3, 2] >= 4 &] (* Ray Chandler, Oct 31 2019 *)
  • PARI
    isA124968(n)={ local(cnt=0,z2) ; for(x=0,floor(sqrt(n)), for(y=x,floor(sqrt(n-x^2)), z2=n-x^2-y^2 ; if( z2>=y^2 && issquare(z2), cnt++ ; ) ; if(cnt >=4, return(1) ) ; ) ; ) ; return(0) ; } { for(n=1,800, if( isA124968(n), print1(n,", ") ; ) ; ) ; } \\ R. J. Mathar

Extensions

Corrected and extended by Ray Chandler and R. J. Mathar, Nov 29 2006

A124971 Numbers n which can be expressed as the ordered sum of 3 squares in 2 or more different ways and such that n+1 has the same property.

Original entry on oeis.org

17, 25, 26, 33, 49, 50, 53, 61, 65, 68, 72, 73, 74, 81, 82, 85, 89, 97, 98, 99, 100, 101, 104, 105, 106, 107, 108, 109, 113, 116, 117, 121, 122, 125, 129, 130, 131, 136, 137, 138, 144, 145, 146, 149, 152, 153, 154, 157, 161, 164, 165, 169, 170, 173, 177, 178
Offset: 1

Views

Author

Artur Jasinski, Nov 14 2006

Keywords

Examples

			a(1)=17 because 17=3^2+2^2+2^2 = 4^2+1^2+0^2 and a(1)+1= 18=3^2+3^2+0^2 = 4^2+1^2+1^2
		

Crossrefs

Programs

  • Mathematica
    Select[Range[200], Length@PowersRepresentations[#, 3, 2] > 1 && Length@PowersRepresentations[# + 1, 3, 2] > 1 &] (* Ray Chandler, Oct 31 2019 *)
  • PARI
    isCnt3sqr(n)={ local(cnt=0,z2) ; for(x=0,floor(sqrt(n)), for(y=x,floor(sqrt(n-x^2)), z2=n-x^2-y^2 ; if( z2>=y^2 && issquare(z2), cnt++ ; ) ; if(cnt >=2, return(1) ) ; ) ; ) ; return(0) ; } isA124971(n)= { return( isCnt3sqr(n) && isCnt3sqr(n+1)) ; } { for(n=1,200, if( isA124971(n), print1(n,", ") ; ) ; ) ; } \\ R. J. Mathar, Nov 29 2006

Formula

A000164(n)>=2 and A000164(n+1)>=2. - R. J. Mathar, Nov 29 2006

Extensions

Corrected and extended by Ray Chandler, Nov 30 2006
Corrected and extended by R. J. Mathar, Nov 29 2006

A124970 Smallest positive integer which can be expressed as the ordered sum of 3 squares in exactly n different ways.

Original entry on oeis.org

7, 1, 9, 41, 81, 146, 194, 306, 369, 425, 594, 689, 866, 1109, 1161, 1154, 1361, 1634, 1781, 1889, 2141, 2729, 2609, 3626, 3366, 3566, 3449, 3506, 4241, 4289, 4826, 5066, 5381, 7034, 5561, 6254, 7229, 7829, 8186, 8069, 8126, 8609, 8921, 8774, 10386, 11574, 11129
Offset: 0

Views

Author

Artur Jasinski, Nov 14 2006, Nov 20 2006

Keywords

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = 1}, While[Length@PowersRepresentations[k, 3, 2] != n, k++]; k]; Table[f[n], {n, 0, 44}] (* Ray Chandler, Oct 31 2019 *)
  • Python
    from collections import Counter
    from itertools import count, combinations_with_replacement as mc
    def aupto(lim):
      sq = filter(lambda x: x<=lim, (i**2 for i in range(int(lim**(1/2))+2)))
      s3 = filter(lambda x: 0Michael S. Branicky, Jul 01 2021

Extensions

Extended by Ray Chandler, Nov 30 2006
a(45) and beyond from Michael S. Branicky, Jul 01 2021

A124969 Numbers which can be expressed as an ordered sum of 3 squares in 5 or more different ways.

Original entry on oeis.org

146, 153, 185, 194, 206, 209, 221, 225, 230, 234, 257, 261, 266, 269, 281, 290, 293, 297, 305, 306, 314, 321, 325, 326, 329, 338, 341, 342, 350, 353, 354, 362, 365, 369, 374, 377, 381, 386, 389, 398, 401, 402, 405, 409, 410, 413, 414, 419, 425, 426, 434
Offset: 1

Views

Author

Artur Jasinski, Nov 14 2006

Keywords

Examples

			a(1)=146 because 146=9^2+7^2+4^2 = 9^2+8^2+1^2 = 11^2+4^2+3^2 = 11^2+5^2+0^2 = 12^2+1^2+1^2
185=0^2+4^2+13^2=0^2+8^2+11^2=2^2+9^2+10^2=4^2+5^2+12^2=6^2+7^2+10^2, so 185 is in the list.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[434], Length@PowersRepresentations[#, 3, 2] >= 5 &] (* Ray Chandler, Oct 31 2019 *)
  • PARI
    isA124969(n)={ local(cnt=0,z2) ; for(x=0,floor(sqrt(n)), for(y=x,floor(sqrt(n-x^2)), z2=n-x^2-y^2 ; if( z2>=y^2 && issquare(z2), cnt++ ; ) ; if(cnt >=5, return(1) ) ; ) ; ) ; return(0) ; } { for(n=1,800, if( isA124969(n), print1(n,", ") ; ) ; ) ; } \\ R. J. Mathar, Dec 07 2006

Extensions

Corrected and extended by Ray Chandler and R. J. Mathar, Nov 29 2006

A294578 Numbers which can be expressed as an ordered sum of 3 squares in 6 or more different ways.

Original entry on oeis.org

194, 209, 269, 281, 290, 297, 306, 314, 321, 326, 329, 341, 342, 365, 369, 374, 386, 389, 401, 425, 426, 434, 441, 446, 449, 450, 458, 459, 461, 482, 485, 486, 489, 494, 497, 506, 509, 513, 521, 530, 531, 534, 542, 545, 546, 549, 554, 558, 561, 566, 569, 578
Offset: 1

Views

Author

Robert Price, Nov 02 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[578], Length[PowersRepresentations[#, 3, 2]] >= 6 &]

Extensions

Updated Mathematica program to Version 11. by Robert Price, Nov 01 2019

A294596 Numbers which can be expressed as an ordered sum of 3 squares in 7 or more different ways.

Original entry on oeis.org

306, 314, 341, 369, 374, 425, 441, 446, 450, 458, 461, 486, 494, 506, 509, 521, 530, 545, 549, 566, 569, 581, 585, 593, 594, 605, 614, 621, 626, 629, 641, 650, 654, 657, 666, 674, 677, 686, 689, 698, 701, 706, 710, 725, 726, 729, 731, 734, 738, 746, 749, 761
Offset: 1

Views

Author

Robert Price, Nov 03 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[761], Length[PowersRepresentations[#, 3, 2]] >= 7 &]

Extensions

Updated Mathematica program to Version 11. by Robert Price, Nov 01 2019

A294597 Numbers which can be expressed as an ordered sum of 3 squares in 8 or more different ways.

Original entry on oeis.org

369, 374, 425, 446, 461, 486, 509, 521, 530, 545, 549, 566, 569, 594, 614, 621, 626, 629, 641, 650, 666, 677, 686, 689, 701, 710, 725, 729, 734, 749, 761, 770, 774, 789, 794, 797, 801, 809, 810, 818, 821, 825, 833, 845, 846, 849, 854, 857, 866, 869, 881, 882
Offset: 1

Views

Author

Robert Price, Nov 03 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[1000],Length[PowersRepresentations[#,3,2]]>7&] (* Harvey P. Dale, Jul 03 2019 *)

A294714 Numbers which can be expressed as an ordered sum of 3 squares in 9 or more different ways.

Original entry on oeis.org

425, 521, 545, 569, 594, 614, 626, 629, 650, 689, 701, 725, 729, 734, 761, 774, 794, 801, 809, 810, 845, 846, 854, 857, 866, 881, 909, 914, 926, 929, 941, 950, 953, 965, 974, 986, 989, 990, 1001, 1025, 1026, 1034, 1041, 1046, 1049, 1053, 1062, 1070, 1074
Offset: 1

Views

Author

Robert Price, Nov 07 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[882], Length[PowersRepresentations[#, 3, 2]] >= 9 &]

Extensions

Updated Mathematica program to Version 11. by Robert Price, Nov 01 2019
Showing 1-10 of 11 results. Next