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 18 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

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

Original entry on oeis.org

9, 17, 18, 25, 26, 27, 29, 33, 34, 36, 38, 41, 45, 49, 50, 51, 53, 54, 57, 59, 61, 62, 65, 66, 68, 69, 72, 73, 74, 75, 77, 81, 82, 83, 85, 86, 89, 90, 94, 97, 98, 99, 100, 101, 102, 104, 105, 106, 107, 108, 109, 110, 113, 114, 116, 117, 118, 121, 122, 123, 125, 126, 129
Offset: 1

Views

Author

Artur Jasinski, Nov 14 2006

Keywords

Examples

			a(1)=9 because 9 = 3^2 + 0^2 + 0^2 or 2^2 + 2^2 + 1^2.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[129], Length@PowersRepresentations[#, 3, 2] >= 2 &] (* Ray Chandler, Oct 31 2019 *)

Formula

Equals = A000027 - A094942 - A004215.

Extensions

Corrected and extended by Ray Chandler, Nov 30 2006

A224443 Numbers that are the sum of three squares (square 0 allowed) in exactly three ways.

Original entry on oeis.org

41, 50, 54, 65, 66, 74, 86, 90, 98, 99, 110, 113, 114, 117, 121, 122, 126, 131, 137, 145, 150, 164, 166, 169, 174, 178, 179, 181, 182, 186, 197, 200, 205, 216, 218, 219, 222, 226, 227, 229, 237, 258, 260, 264, 265, 275, 286, 291, 296, 302
Offset: 1

Views

Author

Wolfdieter Lang, Apr 08 2013

Keywords

Comments

These are the numbers for which A000164(a(n)) = 3.
a(n) is the n-th largest number which has a representation as a sum of three integer squares (square 0 allowed), in exactly three ways, if neither the order of terms nor the signs of the numbers to be squared are taken into account. The multiplicity of a(n) with order and signs taken into account is A005875(a(n)).
This sequence is a proper subsequence of A000378.

Examples

			a(1) = 41  = 0^2 + 4^2 + 5^2  = 1^2 + 2^2 + 6^2 = 3^3 + 4^2 + 4^2, and 41 is the first number m with A000164(m) = 3.
The representations [a,b,c] for n = 1, ..., 10, are:
n=1,  41: [0, 4, 5], [1, 2, 6], [3, 4, 4],
n=2,  50: [0, 1, 7], [0, 5, 5], [3, 4, 5],
n=3,  54: [1, 2, 7], [2, 5, 5], [3, 3, 6],
n=4,  65: [0, 1, 8], [0, 4, 7], [2, 5, 6],
n=5,  66: [1, 1, 8], [1, 4, 7], [4, 5, 5],
n=6,  74: [0, 5, 7], [1, 3, 8], [3, 4, 7],
n=7,  86: [1, 2, 9], [1, 6, 7], [5, 5, 6],
n=8,  90: [0, 3, 9], [1, 5, 8], [4, 5, 7],
n=9,  98: [0, 7, 7], [1, 4, 9], [3, 5, 8],
n=10, 99: [1, 7, 7], [3, 3, 9], [5, 5, 7].
		

Crossrefs

Cf. A000164, A005875, A000378, A094942 (one way), A224442 (two ways).

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0, 1, `if`(t*i^23, 4, min(4, 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 09 2013
  • Mathematica
    Select[ Range[0, 400], Length[ PowersRepresentations[#, 3, 2]] == 3 &] (* Jean-François Alcover, Apr 09 2013 *)

Formula

This sequence gives the increasingly ordered numbers of the set {m integer | m = a^2 + b^2 + c^2, a, b and c integers with 0 <= a <= b <= c, and m has exactly three such representations}.
The sequence gives the increasingly ordered members of the set {m integer | A000164(m) = 3, m >= 0}.

A224442 Numbers that are the sum of three squares (square 0 allowed) in exactly two ways.

Original entry on oeis.org

9, 17, 18, 25, 26, 27, 29, 33, 34, 36, 38, 45, 49, 51, 53, 57, 59, 61, 62, 68, 69, 72, 73, 75, 77, 82, 83, 85, 94, 97, 100, 102, 104, 105, 106, 107, 108, 109, 116, 118, 123, 130, 132, 136, 138, 139, 141, 144, 147, 152, 154, 155, 157, 158, 165, 177, 180, 187
Offset: 1

Views

Author

Wolfdieter Lang, Apr 08 2013

Keywords

Comments

These are the numbers for which A000164(a(n)) = 2.
a(n) is the n-th largest number which has a representation as sum of three integer squares (square 0 allowed), in exactly two ways, if neither the order of terms nor the signs of the numbers to be squared are taken into account. The multiplicity for a(n) with order and signs taken into account is A005875(a(n)).
This sequence is a proper subsequence of A000378.

Examples

			a(1) = 9 = 0^2 + 0^2 + 3^2 = 1^2 + 2^2 + 2^2, and 9 is the smallest number m with A000164(m) = 2 for m >= 0. The multiplicity with order and signs taken into account is 2*3 + 8*3 = 30 = A005875(9).
The two representations [a,b,c] for a(n), n = 1, ..., 10, are
n=1,   9 = [0, 0, 3], [1, 2, 2],
n=2,  17 = [0, 1, 4], [2, 2, 3],
n=3,  18 = [0, 3, 3], [1, 1, 4],
n=4,  25 = [0, 0, 5], [0, 3, 4],
n=5,  26 = [0, 1, 5], [1, 3, 4],
n=6,  27 = [1, 1, 5], [3, 3, 3],
n=7,  29 = [0, 2, 5], [2, 3, 4],
n=8,  33 = [1, 4, 4], [2, 2, 5],
n=9,  34 = [0, 3, 5], [3, 3, 4],
n=10, 36 = [0, 0, 6], [2, 4, 4].
		

Crossrefs

Cf. A000164, A005875, A000378, A094942 (one way), A224443 (three ways).

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0, 1, `if`(t*i^22, 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)<>2 do od; k
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Apr 09 2013
  • Mathematica
    Select[ Range[0, 200], Length[ PowersRepresentations[#, 3, 2]] == 2 &] (* Jean-François Alcover, Apr 09 2013 *)

Formula

This sequence gives the increasingly ordered elements of the set {m integer | m = a^2 + b^2 + c^2, a, b and c integers with 0 <= a <= b <= c, and m has exactly two such representation}.
The sequence gives the increasingly ordered members of the set {m integer | A000164(m) = 2, m >= 0}.

A294577 Numbers that are the sum of three squares (square 0 allowed) in exactly four ways.

Original entry on oeis.org

81, 89, 101, 125, 129, 134, 149, 161, 162, 170, 171, 173, 189, 198, 201, 233, 241, 242, 243, 245, 246, 249, 250, 251, 254, 270, 274, 278, 285, 289, 294, 299, 324, 339, 349, 356, 361, 363, 370, 371, 378, 387, 390, 393, 395, 404, 406, 411, 417, 429, 433, 451
Offset: 1

Views

Author

Robert Price, Nov 02 2017

Keywords

Comments

These are the numbers for which A000164(a(n)) = 4.
a(n) is the n-th largest number which has a representation as a sum of three integer squares (square 0 allowed), in exactly four ways, if neither the order of terms nor the signs of the numbers to be squared are taken into account. The multiplicity of a(n) with order and signs taken into account is A005875(a(n)).
This sequence is a proper subsequence of A000378.

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 1000], Length[PowersRepresentations[#, 3, 2]] == 4 &]

Extensions

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

A294594 Numbers that are the sum of three squares (square 0 allowed) in exactly five ways.

Original entry on oeis.org

146, 153, 185, 206, 221, 225, 230, 234, 257, 261, 266, 293, 305, 325, 338, 350, 353, 354, 362, 377, 381, 398, 402, 405, 409, 410, 413, 414, 419, 437, 470, 474, 477, 481, 491, 514, 525, 539, 557, 563, 579, 582, 584, 586, 590, 611, 612, 625, 630, 635, 638, 642
Offset: 1

Views

Author

Robert Price, Nov 03 2017

Keywords

Comments

These are the numbers for which A000164(a(n)) = 5.
a(n) is the n-th largest number which has a representation as a sum of three integer squares (square 0 allowed), in exactly five ways, if neither the order of terms nor the signs of the numbers to be squared are taken into account. The multiplicity of a(n) with order and signs taken into account is A005875(a(n)).
This sequence is a proper subsequence of A000378.

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 1000], Length[PowersRepresentations[#, 3, 2]] == 5 &]

Extensions

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

A294595 Numbers that are the sum of three squares (square 0 allowed) in exactly six ways.

Original entry on oeis.org

194, 209, 269, 281, 290, 297, 321, 326, 329, 342, 365, 386, 389, 401, 426, 434, 449, 459, 482, 485, 489, 497, 513, 531, 534, 542, 546, 554, 558, 561, 578, 601, 602, 633, 649, 659, 662, 665, 675, 678, 681, 693, 699, 705, 713, 714, 722, 737, 741, 747, 750, 754
Offset: 1

Views

Author

Robert Price, Nov 03 2017

Keywords

Comments

These are the numbers for which A000164(a(n)) = 6.
a(n) is the n-th largest number which has a representation as a sum of three integer squares (square 0 allowed), in exactly six ways, if neither the order of terms nor the signs of the numbers to be squared are taken into account. The multiplicity of a(n) with order and signs taken into account is A005875(a(n)).
This sequence is a proper subsequence of A000378.

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 1000], Length[PowersRepresentations[#, 3, 2]] == 6 &]

Extensions

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

A124978 Smallest positive number which has exactly n different partitions as a sum of 4 squares x^2+y^2+z^2+t^2.

Original entry on oeis.org

1, 4, 18, 34, 50, 66, 82, 114, 90, 130, 150, 178, 162, 198, 318, 210, 250, 234, 322, 406, 465, 330, 306, 402, 462, 390, 474, 378, 490, 486, 654, 610, 522, 450, 778, 678, 642, 570, 666, 726, 594, 714, 770, 774, 986, 630, 738, 945, 1035, 850, 1222, 978, 1014, 918
Offset: 1

Views

Author

Artur Jasinski, Nov 14 2006

Keywords

Comments

Is it known that a(n) always exists? - Franklin T. Adams-Watters, Dec 18 2006
A002635(a(n)) = n. - Reinhard Zumkeller, Jul 13 2014

Examples

			a(4)=34 because 34 is smallest number which has 4 partitions 34=4^2+3^2+3^2+0^2 = 4^2+4^2+1^2+1^2 = 5^2+2^2+2^2+1^2 = 5^2+3^2+0^2+0^2
a(3)=18 which has 3 partitions 18=0^2+0^2+3^2+3^2=0^2+1^2+1^2+4^2=1^2+2^2+2^2+3^2.
		

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndex); import Data.Maybe (fromJust)
    a124978 = (+ 1) . fromJust . (`elemIndex` (tail a002635_list))
    -- Reinhard Zumkeller, Jul 13 2014
  • Mathematica
    kmin[n_] := If[n<5, 1, 10n](* empirical, should be lowered in case of doubt *);
    a[n_] := a[n] = For[k=kmin[n], True, k++, If[Length[PowersRepresentations[ k, 4, 2]] == n, Return[k]]];
    Table[Print[n, " ", a[n]]; a[n], {n, 1, 1000}] (* Jean-François Alcover, Mar 11 2019 *)
  • PARI
    cnt4sqr(n)={ local(cnt=0,t2) ; for(x=0,floor(sqrt(n)), for(y=x,floor(sqrt(n-x^2)), for(z=y,floor(n-x^2-y^2), t2=n-x^2-y^2-z^2 ; if( t2>=z^2 && issquare(n-x^2-y^2-z^2), cnt++ ; ) ; ) ; ) ; ) ; return(cnt) ; }
    A124978(n)= { local(a=1) ; while(1, if( cnt4sqr(a)==n, return(a) ; ) ; a++ ; ) ; }
    { for(n=1,100, print(n," ",A124978(n)) ; ) ; } \\ R. J. Mathar, Nov 29 2006
    

Extensions

Corrected and extended by R. J. Mathar, Nov 29 2006
More terms from Franklin T. Adams-Watters, Dec 18 2006

A294710 Numbers that are the sum of three squares (square 0 allowed) in exactly seven ways.

Original entry on oeis.org

306, 314, 341, 441, 450, 458, 494, 506, 581, 585, 593, 605, 654, 657, 674, 698, 706, 726, 731, 738, 746, 773, 806, 842, 850, 873, 890, 891, 893, 894, 899, 901, 905, 906, 934, 978, 985, 998, 1011, 1013, 1019, 1050, 1058, 1061, 1067, 1073, 1086, 1094, 1101
Offset: 1

Views

Author

Robert Price, Nov 07 2017

Keywords

Comments

These are the numbers for which A000164(a(n)) = 7.
a(n) is the n-th largest number which has a representation as a sum of three integer squares (square 0 allowed), in exactly seven ways, if neither the order of terms nor the signs of the numbers to be squared are taken into account. The multiplicity of a(n) with order and signs taken into account is A005875(a(n)).
This sequence is a proper subsequence of A000378.

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 1000], Length[PowersRepresentations[#, 3, 2]] == 7 &]

Extensions

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

A294711 Numbers that are the sum of three squares (square 0 allowed) in exactly eight ways.

Original entry on oeis.org

369, 374, 446, 461, 486, 509, 530, 549, 566, 621, 641, 666, 677, 686, 710, 749, 770, 789, 797, 818, 821, 825, 833, 849, 869, 882, 902, 945, 954, 962, 969, 971, 981, 1010, 1014, 1017, 1022, 1029, 1069, 1085, 1098, 1146, 1157, 1174, 1221, 1233, 1242, 1245
Offset: 1

Views

Author

Robert Price, Nov 07 2017

Keywords

Comments

These are the numbers for which A000164(a(n)) = 8.
a(n) is the n-th largest number which has a representation as a sum of three integer squares (square 0 allowed), in exactly eight ways, if neither the order of terms nor the signs of the numbers to be squared are taken into account. The multiplicity of a(n) with order and signs taken into account is A005875(a(n)).
This sequence is a proper subsequence of A000378.

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 1000], Length[PowersRepresentations[#, 3, 2]] == 8 &]

Extensions

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