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

A255212 Number A(n,k) of partitions of n^2 into at most k square parts; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 2, 2, 1, 1, 0, 1, 1, 2, 2, 1, 2, 1, 0, 1, 1, 2, 2, 2, 2, 1, 1, 0, 1, 1, 2, 3, 3, 3, 2, 1, 1, 0, 1, 1, 2, 3, 3, 4, 4, 2, 1, 1, 0, 1, 1, 2, 3, 4, 5, 5, 4, 1, 1, 1, 0, 1, 1, 2, 4, 5, 7, 9, 6, 2, 4, 2, 1, 0
Offset: 0

Views

Author

Alois P. Heinz, Feb 17 2015

Keywords

Examples

			Square array A(n,k) begins:
  1, 1, 1, 1, 1,  1,  1,  1,  1,  1,  1, ...
  0, 1, 1, 1, 1,  1,  1,  1,  1,  1,  1, ...
  0, 1, 1, 1, 2,  2,  2,  2,  2,  2,  2, ...
  0, 1, 1, 2, 2,  2,  3,  3,  3,  4,  4, ...
  0, 1, 1, 1, 2,  3,  3,  4,  5,  5,  6, ...
  0, 1, 2, 2, 3,  4,  5,  7,  8,  9, 11, ...
  0, 1, 1, 2, 4,  5,  9, 10, 11, 15, 17, ...
  0, 1, 1, 2, 4,  6,  9, 13, 18, 21, 27, ...
  0, 1, 1, 1, 2,  7,  9, 16, 25, 30, 41, ...
  0, 1, 1, 4, 6,  8, 18, 27, 36, 52, 68, ...
  0, 1, 2, 2, 7, 13, 23, 36, 51, 70, 94, ...
		

Crossrefs

Main diagonal gives A105152.
Cf. A302996.

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0 or i=1 and n<=t, 1,
          (j-> `if`(t*jn, 0, b(n-j, i, t-1))))(i^2))
        end:
    A:= (n, k)-> b(n^2, n, k):
    seq(seq(A(n, d-n), n=0..d), d=0..15);
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[n == 0 || i == 1 && n <= t, 1, Function[j, If[t*jn, 0, b[n-j, i, t-1]]]][i^2]]; A[n_, k_] := b[n^2, n, k]; Table[Table[A[n, d - n], {n, 0, d}], {d, 0, 15}] // Flatten (* Jean-François Alcover, Feb 22 2016, after Alois P. Heinz *)

A181786 Number of inequivalent solutions to n^2 = a^2 + b^2 + c^2 with positive a, b, c.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 1, 1, 0, 3, 0, 2, 1, 1, 1, 3, 0, 2, 3, 3, 0, 6, 2, 3, 1, 2, 1, 8, 1, 3, 3, 4, 0, 10, 2, 5, 3, 4, 3, 8, 0, 5, 6, 6, 2, 11, 3, 6, 1, 8, 2, 12, 1, 6, 8, 8, 1, 15, 3, 8, 3, 7, 4, 20, 0, 6, 10, 9, 2, 16, 5, 9, 3, 9, 4, 15, 3, 15, 8, 10, 0, 22, 5, 11, 6, 9, 6, 18, 2, 11, 11, 14, 3, 21, 6, 13, 1, 12, 8, 31, 2
Offset: 0

Views

Author

T. D. Noe, Nov 12 2010

Keywords

Comments

Note that a(n)=0 for n=0 and the n in A094958.
Also note that a(2n)=a(n), e.g., a(1000)=a(500)=a(250)=a(125)=14. - Zak Seidov, Mar 02 2012
a(n) is the number of distinct parallelepipeds each one having integer diagonal n and integer sides. - César Eliud Lozada, Oct 26 2014

Crossrefs

Programs

  • Mathematica
    nn=100; t=Table[0,{nn}]; Do[n=Sqrt[a^2+b^2+c^2]; If[n<=nn && IntegerQ[n], t[[n]]++], {a,nn}, {b,a,nn}, {c,b,nn}]; Prepend[t,0]

A065458 Number of inequivalent (ordered) solutions to a^2 + b^2 + c^2 + d^2 = n^2.

Original entry on oeis.org

1, 1, 2, 2, 2, 3, 4, 4, 2, 6, 7, 6, 4, 8, 10, 14, 2, 11, 14, 13, 7, 23, 15, 17, 4, 24, 21, 31, 10, 25, 37, 28, 2, 46, 29, 49, 14, 38, 35, 61, 7, 45, 62, 49, 15, 93, 47, 57, 4, 72, 67, 97, 21, 71, 84, 101, 10, 119, 70, 86, 37, 92, 79, 165, 2, 138, 127, 109, 29, 168, 140, 121, 14
Offset: 0

Views

Author

Wouter Meeussen, Nov 18 2001

Keywords

Examples

			a(5)=3 because 25 produces {0,0,0,5}, {0,0,3,4}, {1,2,2,4}.
		

Crossrefs

Column k=4 of A255212.

Programs

  • Maple
    N:= 100:
    R:= Vector(N,1):
    for a from 0 to N do
      for b from a to floor(sqrt(N^2-a^2)) do
         for c from b to floor(sqrt(N^2-a^2-b^2)) do
           q:= a^2 + b^2 + c^2;
           for f in numtheory:-divisors(q) do
              if f^2 + 2*f*c <= q and (f + q/f)::even then
                 r:= (f + q/f)/2;
                 if r <= N then R[r]:= R[r]+1 fi;
              fi
    od od od od:
    convert(R,list); # Robert Israel, Feb 16 2015
  • Mathematica
    Length/@Table[SumOfSquaresRepresentations[4, (k)^2], {k, 72}]

Extensions

a(0)=1 prepended by Alois P. Heinz, Feb 17 2015

A065459 Number of inequivalent (ordered) solutions to n^2 = sum of 5 squares of integers >= 0.

Original entry on oeis.org

1, 1, 2, 2, 3, 4, 5, 6, 7, 8, 13, 12, 13, 17, 25, 22, 27, 31, 35, 38, 46, 49, 61, 61, 61, 73, 92, 83, 112, 106, 118, 127, 147, 138, 185, 175, 178, 198, 239, 212, 254, 262, 298, 294, 341, 304, 404, 376, 385, 432, 483, 441, 539, 517, 560, 551, 680, 587, 745, 693, 698
Offset: 0

Views

Author

Wouter Meeussen, Nov 18 2001

Keywords

Examples

			a(5)=4 because 25 produces {0,0,0,0,5}, {0,0,0,3,4}, {0,1,2,2,4}, {2,2,2,2,3}.
		

Crossrefs

Column k=5 of A255212.

Programs

  • Mathematica
    Length/@Table[SumOfSquaresRepresentations[5, (k)^2], {k, 72}]

Extensions

a(0)=1 prepended by Alois P. Heinz, Feb 17 2015

A181787 Number of solutions to n^2 = a^2 + b^2 + c^2 with positive a, b, c.

Original entry on oeis.org

0, 0, 0, 3, 0, 0, 3, 6, 0, 12, 0, 9, 3, 6, 6, 15, 0, 9, 12, 15, 0, 33, 9, 18, 3, 12, 6, 39, 6, 18, 15, 24, 0, 48, 9, 30, 12, 24, 15, 45, 0, 27, 33, 33, 9, 60, 18, 36, 3, 48, 12, 60, 6, 36, 39, 45, 6, 78, 18, 45, 15, 42, 24, 114, 0, 36, 48, 51, 9, 93, 30, 54, 12, 51, 24, 87, 15, 87, 45, 60, 0, 120, 27, 63, 33, 51, 33, 105, 9, 63, 60, 84, 18, 123, 36, 75, 3, 69, 48, 165, 12
Offset: 0

Views

Author

T. D. Noe, Nov 12 2010

Keywords

Comments

Note that a(n)=0 for n=0 and the n in A094958.

Examples

			a(3)=3 because 3^2 = 1^2+2^2+2^2 = 2^2+1^2+2^2 = 2^2+2^2+1^2. - _Robert Israel_, Aug 02 2019
		

Crossrefs

Programs

  • Maple
    N:= 200: # for a(0)..a(N)
    A:= Array(0..N):
    mults:= [1,3,6]:
    for a from 1 while 3*a^2 <= N^2 do
      if a::odd then b0:= a+1; db:= 2 else b0:= a; db:= 1 fi;
      for b from b0 by db while a^2 + 2*b^2 <= N^2 do
        if (a+b)::odd then c0:= b + (b mod 2); dc:= 2 else c0:= b; dc:= 1 fi;
        for c from c0 by dc do
          v:= a^2 + b^2 + c^2;
          if v > N^2 then break fi;
          if issqr(v) then
            w:= sqrt(v);
            A[w]:= A[w]+ mults[nops({a,b,c})];
          fi
    od od od:
    convert(A,list); # Robert Israel, Aug 02 2019
  • Mathematica
    nn=100; t=Table[0,{nn}]; Do[n=Sqrt[a^2+b^2+c^2]; If[n<=nn && IntegerQ[n], t[[n]]++], {a,nn}, {b,nn}, {c,nn}]; Prepend[t,0]

Formula

a(n) = A063691(n^2). - Michel Marcus, Apr 25 2015
a(2*n) = a(n). - Robert Israel, Aug 02 2019

A181788 Number of solutions to n^2 = a^2 + b^2 + c^2 with nonnegative a, b, c.

Original entry on oeis.org

1, 3, 3, 6, 3, 9, 6, 9, 3, 15, 9, 12, 6, 15, 9, 24, 3, 18, 15, 18, 9, 36, 12, 21, 6, 27, 15, 42, 9, 27, 24, 27, 3, 51, 18, 39, 15, 33, 18, 54, 9, 36, 36, 36, 12, 69, 21, 39, 6, 51, 27, 69, 15, 45, 42, 54, 9, 81, 27, 48, 24, 51, 27, 117, 3, 63, 51, 54, 18, 96, 39, 57, 15, 60, 33, 102, 18, 90, 54, 63, 9, 123, 36, 66, 36, 78, 36, 114, 12, 72, 69, 93, 21, 126, 39, 84, 6, 78, 51, 168, 27
Offset: 0

Views

Author

T. D. Noe, Nov 12 2010

Keywords

Crossrefs

Programs

  • Mathematica
    nn=100; t=Table[0,{nn}]; Do[n=Sqrt[a^2+b^2+c^2]; If[n<=nn && IntegerQ[n], t[[n]]++], {a,0,nn}, {b,0,nn}, {c,0,nn}]; Prepend[t,1]
  • PARI
    {a(n)=local(G=sum(k=0,n,x^(k^2)+x*O(x^(n^2))));polcoeff(G^3,n^2)} /* Paul D. Hanna */
    
  • PARI
    A(n)=my(G=sum(k=0,n,x^(k^2),x*O(x^(n^2)))^3); vector(n+1, k, polcoeff(G,(k-1)^2)) \\ Charles R Greathouse IV, Apr 20 2012

Formula

G.f.: [x^(n^2)] G(x)^3 where G(x) = Sum_{k>=0} x^(k^2); the notation [x^(n^2)] G(x)^3 denotes the coefficient of x^(n^2) in G(x)^3. [From Paul D. Hanna, Apr 20 2012]

A065461 Number of inequivalent (ordered) solutions to n^2 = sum of 7 squares of integers >= 0.

Original entry on oeis.org

1, 1, 2, 3, 4, 7, 10, 13, 16, 27, 36, 43, 58, 72, 99, 130, 146, 178, 254, 265, 342, 417, 507, 540, 726, 745, 975, 1092, 1289, 1338, 1845, 1751, 2246, 2447, 2948, 2852, 3932, 3638, 4728, 4868, 5778, 5618, 7659, 6887, 8891, 8887, 10825, 10109, 13712
Offset: 0

Views

Author

Wouter Meeussen, Nov 18 2001

Keywords

Examples

			a(4)=4 because 16 produces {0,0,0,0,0,0,4}, {0,0,0,2,2,2,2}, {0,0,1,1,1,2,3}, {1,1,1,1,2,2,2}.
		

Crossrefs

Column k=7 of A255212.

Programs

  • Mathematica
    Table[Length[PowersRepresentations[n^2,7,2]],{n,0,50}] (* Harvey P. Dale, Sep 08 2020 *)

Extensions

a(0)=1 prepended by Alois P. Heinz, Feb 17 2015
Previous Mathematica program replaced by Harvey P. Dale, Sep 08 2020

A065460 Number of inequivalent (ordered) solutions to n^2 = sum of 6 squares of integers >= 0.

Original entry on oeis.org

1, 1, 2, 3, 3, 5, 9, 9, 9, 18, 23, 24, 29, 37, 53, 62, 59, 77, 116, 106, 130, 156, 199, 192, 221, 257, 342, 336, 384, 402, 577, 501, 599, 639, 835, 774, 910, 912, 1220, 1113, 1378, 1298, 1703, 1530, 1907, 1862, 2398, 2094, 2471, 2393, 3356, 2765, 3543
Offset: 0

Views

Author

Wouter Meeussen, Nov 18 2001

Keywords

Examples

			a(5)=5 because 25 produces {0,0,0,0,0,5}, {0,0,0,0,3,4}, {0,0,1,2,2,4}, {0,2,2,2,2,3}, {1,1,1,2,3,3}.
		

Crossrefs

Column k=6 of A255212.

Programs

  • Mathematica
    Length/@Table[SumOfSquaresRepresentations[6, (k)^2], {k, 72}]

Extensions

a(0)=1 prepended by Alois P. Heinz, Feb 17 2015

A065462 Number of inequivalent (ordered) solutions to n^2 = sum of 8 squares of integers >= 0.

Original entry on oeis.org

1, 1, 2, 3, 5, 8, 11, 18, 25, 36, 51, 73, 90, 133, 169, 223, 295, 380, 452, 603, 763, 903, 1115, 1385, 1668, 2025, 2398, 2811, 3535, 4011, 4683, 5503, 6724, 7316, 8684, 9946, 11844, 12994, 15091, 16712, 20493, 21663, 24975, 27536, 33079, 34654, 39957, 43315
Offset: 0

Views

Author

Wouter Meeussen, Nov 18 2001

Keywords

Examples

			a(4)=5 because 16 produces {0,0,0,0,0,0,0,4}, {0,0,0,0,2,2,2,2}, {0,0,0,1,1,1,2,3}, {0,1,1,1,1,2,2,2}, {1,1,1,1,1,1,1,3}.
		

Crossrefs

Column k=8 of A255212.

Programs

  • Mathematica
    Length/@Table[SumOfSquaresRepresentations[8, (k)^2], {k, 36}]

Extensions

a(0), a(37)-a(47) from Alois P. Heinz, Feb 16 2015
Showing 1-10 of 11 results. Next