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-2 of 2 results.

A123999 Number of ordered ways of writing n as a sum of 4 squares of nonnegative numbers less than 4.

Original entry on oeis.org

1, 4, 6, 4, 5, 12, 12, 4, 6, 16, 18, 12, 8, 16, 24, 12, 1, 12, 18, 12, 6, 4, 12, 12, 0, 0, 6, 4, 4, 0, 0, 4, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Jonathan Vos Post, Oct 31 2006

Keywords

Comments

Through n = 15, a(n) = number of ordered ways to write n as the sum of 4 squares. For n > 15, we must exclude sums which include 4^2, 5^2, 6^2 and the like. The values of n such that a(n) = 0 are 16, 24, 25, 29, 30, 32, 33, 34, 35 and all n > 36. Without the restriction on the size of squares, all natural numbers can be written as the sum of 4 squares, as Lagrange proved in 1750. This sequence is to 4 as A123337 Number of ordered ways to write n as the sum of 5 squares less than 5, is to 5.

Examples

			a(0) = 1 because of the unique sum 0 = 0^2 + 0^2 + 0^2 + 0^2.
a(1) = 4 because of the 4 permutations 1 = 0^2 + 0^2 + 0^2 + 1^2 = 0^2 + 0^2 + 1^2 + 0^2 = 0^2 + 1^2 + 0^2 + 0^2 = 1^2 + 0^2 + 0^2 + 0^2.
a(4) = 5 because of 4 = 1^2 + 1^2 + 1^2 + 1^2 plus the 4 permutations of 4 = 0^2 + 0^2 + 0^2 + 2^2.
a(16) = 1 because 16 = 2^2 + 2^2 + 2^2 + 2^2.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Total[ Length /@ Permutations /@ IntegerPartitions[n, {4}, Range[0, 3]^2]]; a /@ Range[0, 72] (* Giovanni Resta, Jun 13 2016 *)

Formula

a(n) = Card{(a,b,c,d) such that 0<=a,b,c,d<4 and a^2 + b^2 + c^2 + d^2 = n}.

Extensions

Corrected typo in third example Dave Zobel (dzobel(AT)alumni.caltech.edu), Mar 07 2009
a(16) and related example corrected by Giovanni Resta, Jun 13 2016

A124054 Array(d,n) = number of ordered ways to write n as the sum of d squares less than d, read by rows, through last nonzero value per row.

Original entry on oeis.org

1, 1, 2, 1, 1, 3, 3, 1, 3, 6, 3, 0, 3, 3, 0, 0, 1, 1, 4, 6, 4, 5, 12, 12, 4, 6, 16, 18, 12, 8, 16, 24, 12, 1, 12, 18, 12, 6, 4, 12, 12, 0, 0, 6, 4, 4, 0, 0, 4, 0, 0, 0, 0, 1, 1, 5, 10, 10, 10, 21, 30, 20, 15, 35, 50, 40, 30, 45, 70, 60, 30, 55, 100, 80, 56
Offset: 1

Views

Author

Jonathan Vos Post, Nov 03 2006

Keywords

Comments

Rows terminate with last nonzero element. Row length of row n = A098547 n^3+n^2+1. Row 4 = A123999 Number of ordered ways of writing n as a sum of 4 squares of nonnegative numbers less than 4. Row 5 = A123337 Number of ordered ways to write n as the sum of 5 squares less than 5. Column 0 = A000012 The simplest sequence of positive numbers: the all 1's sequence. Column 1 = A000027 The natural numbers. Column 2 = A000217(n-2) = Triangular numbers C(n-1,2) = n(n-1)/2. Column 3 = A000292(n-2) Tetrahedral numbers = C(n,3).

Examples

			A(1,n) = 1 because the unique ordered way to write 1 as the sum of 0 squares less than 0 is the null set {}.
a(2,n) = 1, 2, 1 = Card{0=0^2+0^2}; Card{1=0^2+1^2,1=1^2+0^2}; Card{2=1^2+1^2}.
a(3,n) = 1, 3, 3, 1, 3, 6, 3, 0, 3, 3, 0, 0, 1.
a(4,n) = 1, 4, 6, 4, 5, 12, 12, 4,  6, 16, 18, ... = A123999.
a(5,n) = 1, 5, 10, 10, 10, 21, 30, 20, 15, 35, ... = A123337.
a(6,n) = 1, 6, 15, 20, 21, 36, 61, 60, 45, 72, ...
a(7,n) = 1, 7, 21, 35, 42, 63, 112, 141, 126, 154, ...
a(8,n) = 1, 8, 28, 56, 78, 112, 196, 288, 309, 344, ...
a(9,n) = 1, 9, 36, 84, 135, 198, 336, 540, 675, 766, ...
a(10,n) = 1, 10, 45, 120, 220, 342, 570, 960, 1350, 1640, ...
		

Crossrefs

Programs

  • Mathematica
    cntper[v_] := Length[v]!/Times @@ ((Last /@ Tally[v])!); sqq[d_, n_] := Total[ cntper /@ IntegerPartitions[n, {d}, Range[0, d - 1]^2]]; Flatten[ Table[ sqq[d, #] & /@ Range[0, d (d - 1)^2], {d, 1, 6}]] (* Giovanni Resta, Jun 16 2016 *)

Formula

A(d,n) for fixed d = Row d = Card{(c_1,c_2,...,c_d) such that 0<=c_i

Extensions

Data corrected by Giovanni Resta, Jun 16 2016
Showing 1-2 of 2 results.