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

A122927 Number of occurrences of n in A122921.

Original entry on oeis.org

1, 4, 9, 15, 21, 24, 37, 38, 48, 50, 61, 62, 81, 75, 87, 93, 109, 99, 123, 109, 138, 132, 149, 133, 178, 154, 179, 171, 198, 179, 215, 196, 233, 211, 238, 221, 268, 236, 268, 246, 299, 269, 302, 282, 323, 295, 327, 305, 374, 322, 355, 337, 396, 339, 402, 358
Offset: 0

Views

Author

Keywords

Comments

The first such occurrence is at A122925(n); the last is at 4n^2.

Crossrefs

A122925 Index of first occurrence of n in A122921.

Original entry on oeis.org

0, 1, 5, 11, 24, 39, 53, 83, 96, 155, 176, 257, 224, 335, 376, 499, 384, 687, 701, 899, 704, 1043, 1104, 1379, 896, 1559, 1584, 1883, 1504, 2239, 2096, 2617, 1536, 2963, 2864, 3259, 2912, 3761, 3728, 3956, 2816, 4529, 4304, 5276, 4416, 5588, 5688, 5849
Offset: 0

Views

Author

Keywords

Comments

The last occurrence of n in A122921 is at 4n^2.

Crossrefs

A122926 Index of first occurrence of n or larger in A122921.

Original entry on oeis.org

0, 1, 5, 11, 24, 39, 53, 83, 96, 155, 176, 224, 224, 335, 376, 384, 384, 687, 701, 704, 704, 896, 896, 896, 896, 1504, 1504, 1504, 1504, 1536, 1536, 1536, 1536, 2816, 2816, 2816, 2816, 2816, 2816, 2816, 2816, 3584, 3584, 3584, 3584, 3584, 3584, 3584, 3584
Offset: 0

Views

Author

Keywords

Comments

Smallest number that cannot be represented as the sum of four squares using only numbers less than n.

Crossrefs

A122922 Express n as the sum of four squares, x^2+y^2+z^2+w^2, x>=y>=z>=w>=0, minimizing the value of x, then minimizing y for that x. a(n) is that y.

Original entry on oeis.org

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

Views

Author

Keywords

Examples

			10 = 2^2 + 2^2 + 1^2 + 1^2, so a(10) = 2. The only representation for 11 is 3^2 + 1^2 + 1^2 + 0^2, so a(11) = 1.
		

Crossrefs

A122923 Express n as the sum of four squares, x^2+y^2+z^2+w^2, x>=y>=z>=w>=0, sequentially minimizing the value of x, y and z. a(n) is that z.

Original entry on oeis.org

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

Views

Author

Keywords

Examples

			10 = 2^2 + 2^2 + 1^2 + 1^2, so a(10) = 1. The only representation for 11 is 3^2 + 1^2 + 1^2 + 0^2, so a(11) = 1.
		

Crossrefs

A122924 Express n as the sum of four squares, x^2+y^2+z^2+w^2, x>=y>=z>=w>=0, sequentially minimizing the value of x, y and z. a(n) is that w.

Original entry on oeis.org

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

Views

Author

Keywords

Examples

			10 = 2^2 + 2^2 + 1^2 + 1^2, so a(10) = 1. The only representation for 11 is 3^2 + 1^2 + 1^2 + 0^2, so a(11) = 1.
		

Crossrefs

A178786 Express n as the sum of four squares, x^2+y^2+z^2+w^2, with x>=y>=z>=w>=0, maximizing the value of x. Then a(n) is that x.

Original entry on oeis.org

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

Views

Author

Sébastien Dumortier, Jun 24 2011

Keywords

Comments

Lagrange's theorem tells us that each positive integer can be written as a sum of four squares.

Crossrefs

Analogs for 3 squares: A261904 and A261915.

Programs

  • Python
    from math import *
    for nbre in range(0, 500): # or more than 500 !
        maxc4=0
        for c1 in range(0, int(sqrt(nbre/4))+1):
            for c2 in range(c1, int(sqrt(nbre/3))+1):
                for c3 in range(c2, int(sqrt(nbre/2))+1):
                    s3=c3**2+c2**2+c1**2
                    if s3<=nbre:
                        c4=sqrt(nbre-s3)
                        if int(c4)==c4 and c4>=c3:
                            if c4>maxc4:
                                maxc4=int(c4)
        print(maxc4, end=', ')

A261904 Largest x such that n can be written as n = x^2 + y^2 + z^2 with x >= y >= z >= 0, or -1 if no such x exists.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Sep 08 2015

Keywords

Comments

a(n) = -1 iff n is in A004215, a(n) >= 0 iff n is in A000378.
Somehow maximizing x seems like the right thing to do (since it is natural to try a greedy algorithm first). If we minimize x we get A261915.

Examples

			Tabls showing initial values of n,x,y,z:
0 0 0 0
1 1 0 0
2 1 1 0
3 1 1 1
4 2 0 0
5 2 1 0
6 2 1 1
7 -1 -1 -1
8 2 2 0
9 3 0 0
10 3 1 0
11 3 1 1
12 2 2 2
13 3 2 0
14 3 2 1
15 -1 -1 -1
16 4 0 0
17 4 1 0
18 4 1 1
19 3 3 1
20 4 2 0
...
		

Crossrefs

Analogs for 4 squares: A178786 and A122921.

Extensions

More terms from David Consiglio, Jr., Sep 08 2015

A261915 Smallest x such that n can be written as n = x^2 + y^2 + z^2 with x >= y >= z >= 0, or -1 if no such x exists.

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 2, -1, 2, 2, 3, 3, 2, 3, 3, -1, 4, 3, 3, 3, 4, 4, 3, -1, 4, 4, 4, 3, -1, 4, 5, -1, 4, 4, 4, 5, 4, 6, 5, -1, 6, 4, 5, 5, 6, 5, 6, -1, 4, 6, 5, 5, 6, 6, 5, -1, 6, 5, 7, 5, -1, 6, 6, -1, 8, 6, 5, 7, 6, 7, 6, -1, 6, 6, 7, 5, 6, 6, 7, -1, 8, 6, 8
Offset: 0

Views

Author

N. J. A. Sloane, Sep 11 2015

Keywords

Comments

a(n) = -1 iff n is in A004215, a(n) >= 0 iff n is in A000378.
If we maximize x we get A261904.

Examples

			Table showing initial values of n,x,y,z:
   0  0  0  0
   1  1  0  0
   2  1  1  0
   3  1  1  1
   4  2  0  0
   5  2  1  0
   6  2  1  1
   7 -1 -1 -1
   8  2  2  0
   9  2  2  1
  10  3  1  0
  11  3  1  1
  12  2  2  2
  13  3  2  0
  14  3  2  1
  15 -1 -1 -1
  16  4  0  0
  17  3  2  2
  18  3  3  0
  19  3  3  1
  20  4  2  0
  ...
		

Crossrefs

Analogs for 4 squares: A178786 and A122921.

Extensions

a(17) corrected, more terms from David Consiglio, Jr., Sep 11 2015
Showing 1-9 of 9 results.