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

A384797 a(n) = A047800(n) - A047800(n-1).

Original entry on oeis.org

2, 3, 4, 5, 5, 7, 7, 8, 9, 10, 10, 12, 11, 12, 14, 15, 13, 17, 15, 18, 18, 19, 17, 21, 21, 21, 22, 23, 22, 26, 23, 26, 27, 24, 28, 31, 28, 29, 29, 34, 28, 34, 32, 32, 37, 34, 35, 38, 36, 38, 38, 39, 34, 40, 42, 44, 43, 44, 42, 49, 42, 42, 46, 45, 51, 50, 46, 47, 50
Offset: 1

Views

Author

Hugo Pfoertner, Jun 17 2025

Keywords

Comments

This is the number of distinct positive distances of the [0,n] X [0,n] points of a lattice square from the origin that are added when the size of the square is increased from n-1 to n. Among the newly added squared distances n^2, n^2+1^2, n^2+2^2, ..., n^2+n^2, some may already have occurred in smaller lattice point squares and are therefore not counted.

Examples

			a(1) = 2: Newly added squared distances are 1 and 2.
a(5) = 5: The squared distance 25=5^2+0^2 already occurs as 4^2+3^2.
a(13) = 11: There are 3 already represented squared distances, 13^2+0^2=12^2+5^2, 13^2+1^2=11^2+7^2, 13^2+4^2=11^2+8^2.
		

Crossrefs

Programs

  • Python
    def A384797(n):
        s = set(i**2+j**2 for i in range(n) for j in range(i+1))
        return n+1-sum(1 for i in range(n+1) if n**2+i**2 in s) # Chai Wah Wu, Jul 07 2025

A225273 T(n,k)=Number of distinct values of the sum of i^2 over n realizations of i in 0..k.

Original entry on oeis.org

2, 3, 3, 4, 6, 4, 5, 10, 10, 5, 6, 15, 19, 14, 6, 7, 20, 32, 29, 18, 7, 8, 27, 45, 50, 38, 22, 8, 9, 34, 67, 74, 66, 47, 26, 9, 10, 42, 88, 111, 99, 82, 56, 30, 10, 11, 51, 116, 149, 147, 124, 98, 65, 34, 11, 12, 61, 145, 197, 201, 183, 149, 114, 74, 38, 12, 13, 71, 179, 247, 262
Offset: 1

Views

Author

R. H. Hardin May 04 2013

Keywords

Comments

Table starts
..2..3..4...5...6...7...8...9..10..11...12...13...14...15...16...17...18...19
..3..6.10..15..20..27..34..42..51..61...71...83...94..106..120..135..148..165
..4.10.19..32..45..67..88.116.145.179..212..260..300..347..402..464..517..592
..5.14.29..50..74.111.149.197.247.308..370..451..526..613..706..815..914.1037
..6.18.38..66..99.147.201.262.332.411..498..601..702..819..946.1078.1221.1375
..7.22.47..82.124.183.250.326.414.513..621..749..874.1018.1176.1338.1515.1706
..8.26.56..98.149.219.299.390.496.614..742..894.1045.1215.1404.1597.1807.2032
..9.30.65.114.174.255.348.454.577.715..863.1038.1216.1412.1630.1856.2098.2357
.10.34.74.130.199.291.397.518.658.815..984.1182.1385.1608.1855.2114.2388.2681
.11.38.83.146.224.327.446.582.739.915.1105.1326.1554.1804.2080.2370.2677.3005

Crossrefs

Row 1 is A000027(n+1)
Row 2 is A047800
Row 3 is A034966
Row 4 is A047801
Row 5 is A132432(n+1)
Row 6 is A132438(n+1)

Formula

Empirical: column k is n*k^2 - A225277(k) for large n (n>36 suffices for k through 210)

A034966 Number of different values of i^2 + j^2 + k^2 for i,j,k in [ 0,n ] (or [ -n,n ]).

Original entry on oeis.org

1, 4, 10, 19, 32, 45, 67, 88, 116, 145, 179, 212, 260, 300, 347, 402, 464, 517, 592, 649, 727, 803, 886, 953, 1057, 1146, 1243, 1343, 1453, 1547, 1680, 1784, 1914, 2041, 2165, 2288, 2454, 2578, 2723, 2866, 3037, 3179, 3363, 3516, 3696, 3868, 4041, 4205
Offset: 0

Views

Author

Keywords

Comments

Number of distinct lengths of main diagonals of all i X j X k boxes with edge lengths i,j,k in [0,n]

Crossrefs

Programs

  • Mathematica
    Table[ Length@Union[ Flatten[ Table[ i^2+j^2+k^2, {i, 0, n}, {j, 0, n}, {k, 0, n} ] ] ], {n, 0, 49} ]

A047801 Number of different values of i^2+j^2+k^2+l^2 for i,j,k,l in [ 0,n ].

Original entry on oeis.org

1, 5, 14, 29, 50, 74, 111, 149, 197, 247, 308, 370, 451, 526, 613, 706, 815, 914, 1037, 1146, 1284, 1416, 1565, 1698, 1876, 2030, 2209, 2380, 2578, 2757, 2972, 3168, 3401, 3612, 3850, 4071, 4339, 4575, 4843, 5089, 5388
Offset: 0

Views

Author

Keywords

Crossrefs

Partial sums of A122927.

Programs

  • Mathematica
    Table[ Length@Union@Flatten@Table[ i^2+j^2+k^2+l^2, {i, 0, n}, {j, i, n}, {k, j, n}, {l, k, n} ], {n, 0, 48} ]

Extensions

Definition corrected by Jonathan Vos Post, Nov 14 2007

A319476 a(n) is the minimum number of distinct distances between n non-attacking rooks on an n X n chessboard.

Original entry on oeis.org

0, 1, 2, 2, 3, 5, 5, 6, 5, 7, 9, 7, 8, 11, 13, 9, 11, 14, 16, 17, 19, 21, 21, 14, 14
Offset: 1

Views

Author

Peter Kagey, Oct 12 2018

Keywords

Comments

a(n) <= n - 1, which is the number of distinct distances the rooks are placed along a diagonal.
Conjecture: a(n^2) = A047800(n-1) - 1. - Peter Kagey, Nov 02 2018

Examples

			For n = 7 a board with a(7) = 5 distinct distances is
  +---+---+---+---+---+---+---+
7 |   |   | * |   |   |   |   |
  +---+---+---+---+---+---+---+
6 |   |   |   |   |   | * |   |
  +---+---+---+---+---+---+---+
5 | * |   |   |   |   |   |   |
  +---+---+---+---+---+---+---+
4 |   |   |   | * |   |   |   |
  +---+---+---+---+---+---+---+.
3 |   |   |   |   |   |   | * |
  +---+---+---+---+---+---+---+
2 |   | * |   |   |   |   |   |
  +---+---+---+---+---+---+---+
1 |   |   |   |   | * |   |   |
  +---+---+---+---+---+---+---+
    A   B   C   D   E   F   G
The distances between pairs of points are:
1)   sqrt(10) (e.g., A5 to B2),
2) 2*sqrt(2)  (e.g., A5 to C7),
3) 4*sqrt(2)  (e.g., B2 to F6),
4) 2*sqrt(10) (e.g., A5 to G3), and
5)   sqrt(26) (e.g., A5 to F6).
		

Crossrefs

Extensions

a(11)-a(14) from Giovanni Resta, Oct 17 2018
a(15)-a(25) from Bert Dobbelaere, Dec 30 2018

A160663 Number of distinct sums that one can obtain by adding two squares among the n first ones.

Original entry on oeis.org

2, 5, 9, 14, 19, 26, 33, 41, 50, 60, 70, 82, 93, 105, 119, 134, 147, 164, 179, 197, 215, 234, 251, 272, 293, 314, 336, 359, 381, 407, 430, 456, 483, 507, 535, 566, 594, 623, 652, 686, 714, 748, 780, 812, 849, 883, 918, 956, 992, 1030, 1068, 1107, 1141, 1181
Offset: 1

Views

Author

Romain CARRE (romain.carre.2008(AT)enseirb.fr), May 22 2009

Keywords

Comments

Essentially the same as A047800: a(n) = A047800(n) - 1.
Let A be the set of the n first squares (1,4,9,...,n^2). Let A+A be the corresponding sumset (= {a,b,a+b where (a,b) in A^2}). That very sequence describes the number of elements of A+A, relatively to n.
a(n-1) is the number of distinct positive distances on an n X n pegboard. What is its asymptotic growth? Can it be efficiently computed for large n? - Charles R Greathouse IV, Jun 13 2013
An upper bound is a(n) <= A102548(2n^2) << n^2/log n. - Charles R Greathouse IV, Jan 16 2023

Examples

			For n = 3, A = {1,4,9}, A+A = {1,4,9} U {2,5,10,8,13,18} thus A+A = {1,2,4,5,8,9,10,13,18}, and hence card(A+A) = 9; a(3) = 9.
		

References

  • Melvyn B. Nathanson (1996). "Additive Number Theory: the Classical Bases" Graduate Texts in Mathematics. 164. Springer-Verlag. p. 192. ISBN 0-387-94656-X.

Programs

  • Maple
    a:= proc(n) local A, i, j; A:= [i^2$i=1..n]; nops([{A[], seq (seq (A[i]+A[j], j=1..i), i=1..nops(A))}[]]) end: seq (a(n), n=1..60); # Alois P. Heinz, Jun 16 2009
  • Mathematica
    a[n_] := (Table[i^2 + j^2, {i, 0, n}, {j, i, n}] // Flatten // Union // Length) - 1; Array[a, 60] (* Jean-François Alcover, May 25 2018 *)
  • PARI
    a(n)=n++; #vecsort(vector(n^2,i,((i-1)\n)^2+((i-1)%n)^2),,8)-1 \\ Charles R Greathouse IV, Jun 13 2013
    
  • PARI
    a(n)=my(u=vector(n,i,i^2),v=List(u)); for(i=1,n, for(j=1,i, listput(v,u[i]+u[j]))); u=0; #Set(v) \\ Charles R Greathouse IV, Nov 18 2022
    
  • PARI
    first(n)=my(v=vector(n),u=[]); for(k=1,n, my(k2=k^2,w=vector(k,i,i^2+k2)); w=setunion(w,[k2]); u=setunion(u,w); v[k]=#u); v \\ Charles R Greathouse IV, Nov 18 2022
  • Python
    def a(n):
        SUM, SQR = set(), set(x**2 for x in range(1, n + 1))
        for i in SQR:
            SUM.add(i)
            for j in SQR: SUM.add(i + j)
        return len(SUM)
    # Romain CARRE (romain.carre.2008(AT)enseirb.fr), Apr 16 2010
    

Formula

a(n) = card(A+A) where A={k^2} k=1..n and A+A = {a,b,a+b where (a,b) in A^2}.
Trivially 2n <= a(n) <= n(n+1)/2. - Charles R Greathouse IV, Oct 30 2015
a(n) << n^2/sqrt(log n) [see A000404]. - Charles R Greathouse IV, Oct 30 2015

Extensions

More terms from Alois P. Heinz, Jun 16 2009

A132432 Number of different values of i^2+j^2+k^2+l^2+m^2 for i,j,k,l,m in [0,n].

Original entry on oeis.org

1, 6, 18, 38, 66, 99, 147, 201, 262, 332, 411, 498, 601, 702, 819, 946, 1078, 1221, 1375, 1533, 1703, 1882, 2076, 2264, 2479, 2691, 2922, 3159, 3403, 3655, 3924, 4193, 4478, 4770, 5071, 5376, 5705, 6032, 6372, 6719, 7081, 7448, 7828, 8214, 8616, 9017, 9438
Offset: 0

Views

Author

Jonathan Vos Post, Nov 13 2007, Nov 14 2007

Keywords

Examples

			a(3) = 18 because the 18 different sums of 5 squares of integers from 0 to 2 are: {20, 17, 16, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0} by permutations of 2^2 + 2^2 + 2^2 + 2^2 + 2^2 = 20; 2^2 + 2^2 + 2^2 + 2^2 + 1^2 = 17; 2^2 + 2^2 + 2^2 + 2^2 + 0^2 = 16; 2^2 + 2^2 + 2^2 + 1^2 + 1^2 = 14; 2^2 + 2^2 + 2^2 + 1^2 + 0^2 = 13; 2^2 + 2^2 + 2^2 + 0^2 + 0^2 = 12; 2^2 + 2^2 + 1^2 + 1^2 + 1^2 = 11; 2^2 + 2^2 + 1^2 + 1^2 + 0^2 = 10; 2^2 + 2^2 + 1^2 + 0^2 + 0^2 = 9; 2^2 + 2^2 + 0^2 + 0^2 + 0^2 = 2^2 + 1^2 + 1^2 + 1^2 + 1^2 = 8; 2^2 + 1^2 + 1^2 + 1^2 + 0^2 = 7; 2^2 + 1^2 + 1^2 + 0^2 + 0^2 = 6; 2^2 + 1^2 + 0^2 + 0^2 + 0^2 = 1^2 + 1^2 + 1^2 + 1^2 + 1^2 = 5; 2^2 + 0^2 + 0^2 + 0^2 + 0^2 = 1^2 + 1^2 + 1^2 + 1^2 + 0^2 = 4; 1^2 + 1^2 + 1^2 + 0^2 + 0^2 = 3; 1^2 + 1^2 + 0^2 + 0^2 + 0^2 = 2; 1^2 + 0^2 + 0^2 + 0^2 + 0^2 = 1; 0^2 + 0^2 + 0^2 + 0^2 + 0^2 = 0.
		

Crossrefs

Programs

  • Maple
    S:= proc(k,n) option remember;
    if k = 0 or n = 0 then {0} else
    `union`(seq(map(`+`,procname(j,n-1),(k-j)*n^2),j=1..k-1),
    {k*n^2},procname(k,n-1)) fi end proc:
    seq(nops(S(5,n)),n=0..100); # Robert Israel, Jun 28 2018
  • Mathematica
    Table[Length@ Union@Flatten@ Table[i^2 + j^2 + k^2 + l^2 + m^2, {i, 0, n}, {j, i, n}, {k, j, n}, {l, k, n}, {m, l, n}], {n, 0, 49}]

Extensions

Offset corrected by Giovanni Resta, Jun 18 2016

A374707 Number of distinct sums i^3 + j^3 for 0<=i<=j<=n.

Original entry on oeis.org

1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 90, 104, 119, 135, 151, 169, 188, 208, 229, 251, 274, 298, 322, 348, 375, 402, 431, 461, 492, 524, 556, 590, 623, 659, 695, 733, 772, 811, 851, 893, 936, 980, 1025, 1071, 1118, 1166, 1213, 1263, 1314, 1365, 1418, 1471, 1525, 1580, 1637, 1695, 1753
Offset: 0

Views

Author

Seiichi Manyama, Jul 17 2024

Keywords

Crossrefs

Programs

  • PARI
    a(n) = my(v=vector(2*n^3+1)); for(i=0, n, for(j=i, n, v[i^3+j^3+1]+=1)); sum(i=1, #v, v[i]>0);

A384798 Records in A384797.

Original entry on oeis.org

2, 3, 4, 5, 7, 8, 9, 10, 12, 14, 15, 17, 18, 19, 21, 22, 23, 26, 27, 28, 31, 34, 37, 38, 39, 40, 42, 44, 49, 51, 56, 58, 64, 69, 71, 73, 77, 79, 82, 92, 94, 101, 104, 108, 109, 111, 116, 118, 120, 129, 136, 140, 141, 155, 160, 172, 174, 181, 190, 193, 194, 208, 209
Offset: 1

Views

Author

Hugo Pfoertner, Jun 17 2025

Keywords

Crossrefs

Programs

  • Python
    from itertools import count, islice
    def A384798_gen(): # generator of terms
        s, m = {0}, 1
        for n in count(1):
            c = n+1
            for i in range(n+1):
                if (k:=n**2+i**2) in s:
                    c -= 1
                else:
                    s.add(k)
            if c>m:
                yield c
                m = c
    A384798_list = list(islice(A384798_gen(),30)) # Chai Wah Wu, Jul 07 2025

A384799 Positions of records in A384797.

Original entry on oeis.org

1, 2, 3, 4, 6, 8, 9, 10, 12, 15, 16, 18, 20, 22, 24, 27, 28, 30, 33, 35, 36, 40, 45, 48, 52, 54, 55, 56, 60, 65, 70, 78, 80, 90, 95, 100, 105, 108, 110, 120, 130, 135, 140, 150, 155, 156, 160, 165, 168, 180, 190, 200, 205, 210, 225, 240, 255, 260, 270, 280, 285, 300
Offset: 1

Views

Author

Hugo Pfoertner, Jun 17 2025

Keywords

Crossrefs

Programs

  • Python
    from itertools import count, islice
    def A384799_gen(): # generator of terms
        s, m = {0}, 1
        for n in count(1):
            c = n+1
            for i in range(n+1):
                if (k:=n**2+i**2) in s:
                    c -= 1
                else:
                    s.add(k)
            if c>m:
                yield n
                m = c
    A384799_list = list(islice(A384799_gen(),30)) # Chai Wah Wu, Jul 07 2025
Showing 1-10 of 16 results. Next