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

A191091 Least number of squares required when writing n as a sum of squares with the smallest square as large as possible.

Original entry on oeis.org

1, 2, 3, 1, 2, 3, 4, 2, 1, 2, 3, 3, 2, 3, 4, 1, 3, 2, 3, 2, 4, 3, 4, 3, 1, 4, 3, 4, 2, 5, 4, 2, 3, 2, 5, 1, 4, 3, 6, 2, 2, 4, 3, 3, 2, 5, 4, 3, 1, 2, 5, 2, 2, 3, 6, 3, 3, 2, 3, 4, 2, 3, 4, 1, 2, 3, 3, 3, 3, 3, 4, 2, 4, 2, 3, 4, 3, 3, 4, 2, 1, 4, 3, 4, 2, 3, 4
Offset: 1

Views

Author

T. D. Noe, Jul 21 2011

Keywords

Comments

The smallest value in the sum is A191090. All sums have at most 6 terms for n <= 1000. Is this the largest possible value? For n up to 1000, only 39, 55, 143, 543, and 564 need 6 terms.

Examples

			The sum for 30 gives the first sum having 5 terms: 4 + 4 + 4 + 9 + 9.
		

Crossrefs

Programs

  • Mathematica
    Table[s=DeleteCases[#, 0]& /@ PowersRepresentations[n,11,2]; t=Last[Union[First /@ Union /@ s]]; Min @@ Length /@ Select[s, #[[1]] == t &], {n, 100}]

A193018 The largest integer that cannot be written as the sum of squares of integers larger than n.

Original entry on oeis.org

23, 87, 119, 201, 312, 376, 455, 616, 760, 840, 1055, 1136, 1248, 1472, 1719, 1959, 2064, 2472, 2764, 2976, 3264, 3407, 3584, 4032, 4336, 4848, 4992, 5088, 5523, 5900, 6112, 6624, 7360, 7680, 7680, 8448, 8960, 9152, 9856, 10208, 11136, 11904, 12256, 12256
Offset: 2

Views

Author

Remmert Borst, Jul 14 2011

Keywords

Comments

Numbers can be used more than once.

Crossrefs

Programs

  • Mathematica
    a[n_] := Block[{k = 4, f}, While[ (n+k)^2 <= (f = FrobeniusNumber[ Range[ n, n+k]^2]), k++]; f]; a /@ Range[2, 45] (* Giovanni Resta, Jun 13 2016 *)

Formula

a(n) < n^4 + 6n^3 + 11n^2 + 6n by Sylvester's theorem. [Charles R Greathouse IV, Jul 14 2011]
a(n) = o(n^{2+e}) for all e > 0, according to Dutch and Rickett. [Jeffrey Shallit, Mar 17 2021]
a(n) = O(n^2), according to Moscariello. [Jeffrey Shallit, Mar 17 2021]

A241898 a(n) is the largest integer such that n = a(n)^2 + ... is a decomposition of n into a sum of at most four nondecreasing squares.

Original entry on oeis.org

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

Views

Author

Moshe Shmuel Newman, May 15 2014

Keywords

Comments

This differs from A191090 only for n>=30 because 30 cannot be written as a sum of at most four squares without using 1^2, but 30 can be written as a sum of five nondecreasing squares: 2^2 + 2^2 + 2^2 + 3^2 + 3^2, making A191090(30)=2.
By Lagrange's Theorem every number can be written as a sum of four squares. Can the same be said of the set of {a^2|a is any integer not equal to 7}? From the data that I have, it would seem that a(n) is greater than 7 for all n>599. If this could be proved, it would only remain to check if all the numbers up to 599 can be written as the sum of 4 squares none of which is 7^2.

Examples

			30 can be written as the sum of at most 4 nondecreasing squares in the following ways: 1^2 + 2^2 + 5^2 or 1^2 + 2^2 + 3^2 + 4^2. Therefore, a(30)=1.
		

Crossrefs

Cf. A191090.

Programs

  • Maple
    b:= proc(n, i, t) option remember; n=0 or t>0 and
           i^2<=n and (b(n, i+1, t) or b(n-i^2, i, t-1))
        end:
    a:= proc(n) local k;
          for k from isqrt(n) by -1 do
            if b(n, k, 4) then return k fi
          od
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, May 25 2014
  • Mathematica
    For[i=0,i<=7^4,i++,a[i]={}];
    For[i1=0,i1<=7,i1++,
    For[i2=0,i2<=7,i2++,
    For[i3=0,i3<=7,i3++,
    For[i4=0,i4<=7,i4++,
    sumOfSquares=i1^2+i2^2+i3^2+i4^2;
    smallestSquare=Min[DeleteCases[{i1,i2,i3,i4},0]];
    a[sumOfSquares]=Union[{smallestSquare},a[sumOfSquares]] ]]]];
    Table[Max[a[i]],{i,1,50}]
Showing 1-3 of 3 results.