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

A080654 Smallest number with exactly n representations as a sum of five positive squares or 0 if no such number exists (cf. A025429).

Original entry on oeis.org

5, 20, 29, 62, 53, 80, 77, 91, 101, 107, 128, 133, 131, 139, 166, 163, 181, 187, 179, 219, 203, 214, 227, 238, 211, 262, 275, 251, 291, 277, 314, 298, 259, 299, 326, 307, 399, 334, 374, 346, 347, 355, 373, 331, 411, 391, 430, 371, 445, 421, 394, 486, 379, 406
Offset: 1

Views

Author

Rainer Rosenthal, Mar 01 2003

Keywords

Comments

It seems as if 33 is the largest number with no such representation. 60 seems to be the largest one with exactly one representation.
More generally, see A080673 for the largest number with n such representations. - M. F. Hasler, Mar 04 2016

Examples

			a(4) = 62 because there are exactly four representations as a sum of 5 squares: 62 = 1+4+4+4+49 = 1+4+16+16+25 = 4+4+4+25+25 = 4+4+9+9+36.
		

Crossrefs

Programs

  • Mathematica
    f[k_] := f[k] = Length[Select[PowersRepresentations[k, 5, 2], #[[1]] > 0 &]]; a[n_] := (k = 1; While[f[k++] != n]; k-1); Array[a, 54] (* Jean-François Alcover, Apr 26 2011 *)
    f[n_] := f[n] = Block[{c = Range@ Sqrt@ n^2}, Length@ IntegerPartitions[n, {5}, c]]; t = Array[f, 50000, 0]; Table[ Position[t, n, 1, 1], {n, 190}] - 1 (* Robert G. Wilson v, Jun 01 2014 *)

Extensions

More terms from Reinhard Zumkeller, Apr 26 2004
Definition adjusted to cope with otherwise undefined values and b-file extended by Hagen von Eitzen, Jun 05 2014

A243077 Numbers missing from A025429 (number of partitions of n into 5 nonzero squares).

Original entry on oeis.org

188, 259, 304, 308, 372, 394, 483, 497, 594, 634, 685, 705, 722, 729, 740, 750, 756, 766, 780, 782, 834, 850, 864, 884, 885, 888, 922, 925, 946, 955, 956, 1016, 1026, 1048, 1069, 1070, 1071, 1080, 1082, 1108, 1134, 1140, 1154, 1159, 1160, 1161, 1187, 1198, 1266, 1268
Offset: 1

Views

Author

M. F. Hasler, May 30 2014 and Hagen von Eitzen, Jun 05 2014

Keywords

Comments

For these indices, A080654 and A080673 are ill-defined. Stated another way, a(n) is the n-th index where A080654 and A080673 default to 0.

Examples

			a(1)=188 because all the values 0, 1, ..., 187 appear somewhere in A025429, but 188 doesn't.
		

Crossrefs

Extensions

Edited by N. J. A. Sloane, Jun 06 2014

A294675 Numbers that are the sum of 5 nonzero squares in exactly 1 way.

Original entry on oeis.org

5, 8, 11, 13, 14, 16, 17, 19, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31, 34, 36, 39, 42, 57, 60
Offset: 1

Views

Author

Robert Price, Nov 06 2017

Keywords

Comments

The sequence is likely to be finite and complete as the next term, if it exists, is > 50000.
From a proof by David A. Corneth on Nov 08 2017 in A294736: This sequence is complete, see the von Eitzen Link and Price's computation that the next term must be > 50000. Proof. The link mentions "for positive integer n, if n > 5408 then the number of ways to write n as a sum of 5 squares is at least Floor(Sqrt(n - 101) / 8)". So for n > 5408, there are more than one way to write n as a sum of 5 squares. For n <= 5408, it has been verified if n is in the sequence by inspection. Hence the sequence is complete.

References

  • E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, New York, 1985, p. 86, Theorem 1.

Crossrefs

Programs

  • Mathematica
    Select[Range[100], Length[Select[PowersRepresentations[#, 5, 2], #[[1]] > 0&]] == 1&] (* Jean-François Alcover, Feb 25 2019 *)
    b[n_, i_, k_, t_] := b[n, i, k, t] = If[n == 0, If[t == 0, 1, 0], If[i<1 || t<1, 0, b[n, i - 1, k, t] + If[i^2 > n, 0, b[n - i^2, i, k, t - 1]]]];
    T[n_, k_] := b[n, Sqrt[n] // Floor, k, k];
    Position[Table[T[n, 5], {n, 0, 100}], 1] - 1 // Flatten (* Jean-François Alcover, Nov 06 2020, after Alois P. Heinz in A243148 *)

Formula

A243148(a(n),5) = 1. - Alois P. Heinz, Feb 25 2019

A243148 Triangle read by rows: T(n,k) = number of partitions of n into k nonzero squares; n >= 0, 0 <= k <= n.

Original entry on oeis.org

1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1
Offset: 0

Views

Author

Alois P. Heinz, May 30 2014

Keywords

Examples

			T(20,5) = 2 = #{ (16,1,1,1,1), (4,4,4,4,4) } since 20 = 4^2 + 4 * 1^2 = 5 * 2^2.
Triangle T(n,k) begins:
  1;
  0, 1;
  0, 0, 1;
  0, 0, 0, 1;
  0, 1, 0, 0, 1;
  0, 0, 1, 0, 0, 1;
  0, 0, 0, 1, 0, 0, 1;
  0, 0, 0, 0, 1, 0, 0, 1;
  0, 0, 1, 0, 0, 1, 0, 0, 1;
  0, 1, 0, 1, 0, 0, 1, 0, 0, 1;
  0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1;
  0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1;
  0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1;
  (...)
		

Crossrefs

Columns k = 0..10 give: A000007, A010052 (for n>0), A025426, A025427, A025428, A025429, A025430, A025431, A025432, A025433, A025434.
Row sums give A001156.
T(2n,n) gives A111178.
T(n^2,n) gives A319435.
T(n,k) = 1 for n in A025284, A025321, A025357, A294675, A295670, A295797 (for k = 2..7, respectively).

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(n=0, `if`(t=0, 1, 0),
          `if`(i<1 or t<1, 0, b(n, i-1, t)+
          `if`(i^2>n, 0, b(n-i^2, i, t-1))))
        end:
    T:= (n, k)-> b(n, isqrt(n), k):
    seq(seq(T(n, k), k=0..n), n=0..14);
    # second Maple program:
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
          b(n, i-1)+(s-> `if`(s>n, 0, expand(x*b(n-s, i))))(i^2)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..n))(b(n, isqrt(n))):
    seq(T(n), n=0..14);  # Alois P. Heinz, Oct 30 2021
  • Mathematica
    b[n_, i_, k_, t_] := b[n, i, k, t] = If[n == 0, If[t == 0, 1, 0], If[i < 1 || t < 1, 0, b[n, i-1, k, t] + If[i^2 > n, 0, b[n-i^2, i, k, t-1]]]]; T[n_, k_] := b[n, Sqrt[n] // Floor, k, k]; Table[Table[T[n, k], {k, 0, n}], {n, 0, 14}] // Flatten (* Jean-François Alcover, Jun 06 2014, after Alois P. Heinz *)
    T[n_, k_] := Count[PowersRepresentations[n, k, 2], r_ /; FreeQ[r, 0]]; T[0, 0] = 1; Table[T[n, k], {n, 0, 14}, {k, 0, n}] // Flatten (* Jean-François Alcover, Feb 19 2016 *)
  • PARI
    T(n,k,L=n)=if(n>k*L^2, 0, k>n-3, k==n, k<2, issquare(n,&n) && n<=L*k, k>n-6, n-k==3, L=min(L,sqrtint(n-k+1)); sum(r=0,min(n\L^2,k-1),T(n-r*L^2,k-r,L-1), n==k*L^2)) \\ M. F. Hasler, Aug 03 2020

Formula

T(n,k) = [x^n y^k] 1/Product_{j>=1} (1-y*x^A000290(j)).
Sum_{k=1..n} k * T(n,k) = A281541(n).
Sum_{k=1..n} n * T(n,k) = A276559(n).
Sum_{k=0..n} (-1)^k * T(n,k) = A292520(n).

A000174 Number of partitions of n into 5 squares.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 1, 1, 2, 2, 2, 2, 2, 3, 2, 1, 3, 3, 3, 3, 4, 3, 3, 2, 2, 4, 4, 4, 4, 5, 3, 3, 4, 3, 5, 5, 5, 6, 5, 3, 5, 5, 5, 6, 5, 6, 5, 4, 4, 6, 7, 6, 8, 8, 7, 5, 6, 5, 8, 8, 4, 9, 7, 6, 7, 7, 8, 9, 9, 7, 9, 6, 7, 8, 10, 9, 9, 11, 7, 8, 8, 8, 11, 11, 9, 12, 11, 7, 9, 9, 12, 13, 9, 10, 11, 8, 6, 10, 13, 13, 13
Offset: 0

Views

Author

Keywords

References

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

Crossrefs

Equivalent sequences for other numbers of squares: A010052 (1), A000161 (2), A000164 (3), A002635 (4), A000177 (6), A025422 (7), A025423 (8), A025424 (9), A025425 (10).
Cf. A025429, A295160 (largest number k with a(k) = n).

Programs

  • Mathematica
    Table[PowersRepresentations[n, 5, 2] // Length, {n, 0, 100}] (* Jean-François Alcover, Feb 04 2016 *)

A000132 Number of ways of writing n as a sum of 5 squares.

Original entry on oeis.org

1, 10, 40, 80, 90, 112, 240, 320, 200, 250, 560, 560, 400, 560, 800, 960, 730, 480, 1240, 1520, 752, 1120, 1840, 1600, 1200, 1210, 2000, 2240, 1600, 1680, 2720, 3200, 1480, 1440, 3680, 3040, 2250, 2800, 3280, 4160, 2800, 1920, 4320, 5040, 2800, 3472, 5920
Offset: 0

Views

Author

Keywords

Comments

The units digit of a(n) is 2 if n=5*t^2 for some natural number t, and 0 otherwise. See Moreno & Wagstaff, p. 258, exercise 2. - Ant King, Mar 17 2013
See A025429 for the number of partitions of n into five nonzero squares. - M. F. Hasler, May 30 2014
Also, theta series of lattice Z^5. - Sean A. Irvine, Jul 27 2020

Examples

			G.f. = 1 + 10*x + 40*x^2 + 80*x^3 + 90*x^4 + 112*x^5 + 240*x^6 + ...
		

References

  • E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985, p. 128.
  • J. Carlos Moreno and Samuel S. Wagstaff Jr., Sums Of Squares Of Integers, Chapman & Hall/CRC, (2006). [Ant King, Mar 17 2013]

Crossrefs

5th column of A286815. - Seiichi Manyama, May 27 2017
Row d=5 of A122141.

Programs

  • Mathematica
    Table[SquaresR[5, n], {n, 0, 46}] (* Ray Chandler, Nov 28 2006 *)
    SquaresR[5,Range[0,50]] (* Harvey P. Dale, Aug 26 2011 *)
  • PARI
    a(n, k=5) = if(n==0, return(1)); if(k <= 0, return(0)); if(k==1, return(issquare(n))); my(count = 0); for(v = 0, sqrtint(n), count += (2 - (v == 0))*if(k > 2, a(n - v^2, k-1), issquare(n - v^2) * (2 - (n - v^2 == 0)))); count; \\ Daniel Suteu, Aug 28 2021
    
  • Python
    # uses Python code from A000118
    from math import isqrt
    def A000132(n): return A000118(n)+(sum(A000118(n-k**2) for k in range(1,isqrt(n)+1))<<1) # Chai Wah Wu, Jun 23 2024
  • Sage
    Q = DiagonalQuadraticForm(ZZ, [1]*5)
    Q.representation_number_list(47) # Peter Luschny, Jun 20 2014
    

Formula

G.f.: (Sum_{j=-oo..+oo} x^(j^2))^5. - R. J. Mathar, Jul 31 2007
a(n) = (10/n)*Sum_{k=1..n} A186690(k)*a(n-k), a(0) = 1. - Seiichi Manyama, May 27 2017
a(n) = A000118(n) + 2*Sum_{k=1..floor(sqrt(n))} A000118(n - k^2). - Daniel Suteu, Aug 28 2021

Extensions

Extended by Ray Chandler, Nov 28 2006

A294736 Numbers that are the sum of 5 nonzero squares in exactly 2 ways.

Original entry on oeis.org

20, 38, 41, 45, 47, 48, 49, 50, 54, 55, 63, 66, 81, 105
Offset: 1

Views

Author

Robert Price, Nov 07 2017

Keywords

Comments

Inspected values of n <= 50000.
This sequence is complete, see the von Eitzen Link and Price's computation that the next term must be > 50000. Proof. The link mentions "for positive integer n, if n > 5408 then the number of ways to write n as a sum of 5 squares is at least Floor(Sqrt(n - 101) / 8)". So for n > 5408, there are more than two ways to write n as a sum of 5 squares. For n <= 5408, it has been verified if n is in the sequence by inspection. Hence the sequence is complete." - David A. Corneth, Nov 08 2017

Examples

			There are exactly two ways 20 is a sum of 5 nonzero squares. These are 1^2 + 1^2 + 1^2 + 1^2 + 4^2 = 2^2 + 2^2 + 2^2 + 2^2 + 2^2 = 20. Therefore 20 is in the sequence.
		

References

  • E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, New York, 1985, p. 86, Theorem 1.

Crossrefs

Programs

  • Mathematica
    Select[Range[200], Length[Select[PowersRepresentations[#, 5, 2], #[[1]] > 0&]] == 2&] (* Jean-François Alcover, Nov 06 2020 *)

Formula

A243148(a(n),5) = 2. - Alois P. Heinz, Feb 26 2019

A340481 Number of ways to write n as an ordered sum of 5 squares of positive integers.

Original entry on oeis.org

1, 0, 0, 5, 0, 0, 10, 0, 5, 10, 0, 20, 5, 0, 30, 6, 10, 20, 20, 30, 5, 30, 30, 20, 35, 10, 60, 45, 0, 60, 50, 30, 45, 50, 60, 70, 35, 30, 110, 50, 31, 110, 80, 80, 50, 70, 120, 70, 75, 90, 140, 110, 20, 140, 160, 60, 135, 120, 120, 180, 40, 130, 230, 80, 120, 170, 200, 155, 85, 200, 190
Offset: 5

Views

Author

Ilya Gutkovskiy, Jan 31 2021

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, t) option remember;
          `if`(n=0, `if`(t=0, 1, 0), `if`(t<1, 0, add((s->
          `if`(s>n, 0, b(n-s, t-1)))(j^2), j=1..isqrt(n))))
        end:
    a:= n-> b(n, 5):
    seq(a(n), n=5..75);  # Alois P. Heinz, Jan 31 2021
  • Mathematica
    nmax = 75; CoefficientList[Series[(EllipticTheta[3, 0, x] - 1)^5/32, {x, 0, nmax}], x] // Drop[#, 5] &

Formula

G.f.: (theta_3(x) - 1)^5 / 32, where theta_3() is the Jacobi theta function.

A345508 Numbers that are the sum of ten squares in one or more ways.

Original entry on oeis.org

10, 13, 16, 18, 19, 21, 22, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81
Offset: 1

Views

Author

David Consiglio, Jr., Jun 19 2021

Keywords

Examples

			13 is a term because 13 = 1^2 + 1^2 + 1^2 + 1^2 + 1^2 + 1^2 + 1^2 + 1^2 + 1^2 + 2^2.
		

Crossrefs

Programs

  • Python
    from itertools import combinations_with_replacement as cwr
    from collections import defaultdict
    keep = defaultdict(lambda: 0)
    power_terms = [x**2 for x in range(1, 1000)]
    for pos in cwr(power_terms, 10):
        tot = sum(pos)
        keep[tot] += 1
        rets = sorted([k for k, v in keep.items() if v >= 1])
        for x in range(len(rets)):
            print(rets[x])
    
  • Python
    def A345508(n): return (10, 13, 16, 18, 19, 21, 22)[n-1] if n<8 else n+16 # Chai Wah Wu, May 09 2024

Formula

From Chai Wah Wu, May 09 2024: (Start)
All integers >= 24 are terms. Proof: since 5 can be written as the sum of 5 positive squares and any integer >= 34 can be written as a sum of 5 positive squares (see A025429), any integer >= 39 can be written as a sum of 10 positive squares. Integers from 24 to 38 are terms by inspection.
a(n) = 2*a(n-1) - a(n-2) for n > 9.
G.f.: x*(-x^8 + x^7 - x^6 + x^5 - x^4 - x^3 - 7*x + 10)/(x - 1)^2. (End)

A080673 Largest number with exactly n representations as sum of five positive squares (or 0 if no number with exactly n representations exists).

Original entry on oeis.org

33, 60, 105, 90, 132, 177, 145, 201, 225, 180, 297, 228, 213, 265, 345, 258, 305, 300, 393, 369, 465, 417, 385, 337, 420, 425, 513, 537, 409, 473, 449, 585, 561, 545, 481, 505, 633, 540, 528, 705, 593, 462, 665, 681, 617, 825, 564, 753, 548, 689, 777, 713
Offset: 0

Views

Author

Rainer Rosenthal, Mar 02 2003

Keywords

Comments

a(0) = 33 has been asked as a riddle by Gerhard Woeginger in de.rec.denksport.
There is no number <= 10^6 that is the sum of five positive squares in exactly 188 ways. - Donovan Johnson, Aug 15 2013
Donovan Johnson's exhaustive search in fact shows that a(188) is undefined / should be assigned the default value 0. Hagen von Eitzen, Jun 05 2014
In what sense the search is exhaustive? Is any of the 0's of the b-file proved? - M. F. Hasler, Oct 27 2017

Examples

			A known result says a(0) = 33, since there is no representation of 33 as sum of 5 positive squares.
a(1) = 60 is the largest number allowing exactly one such representation.
		

Crossrefs

Programs

  • Mathematica
    max = 1000; m = Ceiling[Sqrt[max]]; xx = Array[x, 6, 0]; x[0] = 1; iter = Sequence @@ Thread[{Rest[xx], Most[xx], m}]; representations = Table[ Rest[xx] . Rest[xx], Evaluate[iter]] // Flatten // Sort // Split // Select[#, First[#] <= max &] &; counts = {First[#], Length[#]} & /@ representations; a[0] = Complement[Range[max], counts[[All, 1]]] // Last; a[n_] := Select[counts, #[[2]] == n &] // Last // First; Table[a[n], {n, 0, 51}] (* Jean-François Alcover, Jul 12 2012 *)

Formula

a(n) = max { k | A025429(k) = n }. - M. F. Hasler, May 30 2014

Extensions

a(15)-a(51) from Donovan Johnson, Aug 23 2010
Definition adjusted to cope with otherwise undefined values and b-file extended by Hagen von Eitzen, Jun 04 2014
Showing 1-10 of 23 results. Next