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.

A002414 Octagonal pyramidal numbers: a(n) = n*(n+1)*(2*n-1)/2.

Original entry on oeis.org

1, 9, 30, 70, 135, 231, 364, 540, 765, 1045, 1386, 1794, 2275, 2835, 3480, 4216, 5049, 5985, 7030, 8190, 9471, 10879, 12420, 14100, 15925, 17901, 20034, 22330, 24795, 27435, 30256, 33264, 36465, 39865, 43470, 47286, 51319, 55575, 60060, 64780
Offset: 1

Views

Author

Keywords

Comments

Number of ways of covering a 2n X 2n lattice with 2n^2 dominoes with exactly 2 horizontal dominoes. - Yong Kong (ykong@curagen.com), May 06 2000
Equals binomial transform of [0, 1, 7, 6, 0, 0, 0, ...]. - Gary W. Adamson, Jun 14 2008, corrected Oct 25 2012
Sequence of the absolute values of the z^1 coefficients of the polynomials in the GF3 denominators of A156927. See A157704 for background information. - Johannes W. Meijer, Mar 07 2009
This sequence is related to A000326 by a(n) = n*A000326(n) - Sum_{i=0..n-1} A000326(i) and this is the case d=3 in the identity n*(n*(d*n-d+2)/2)-Sum_{k=0..n-1} k*(d*k-d+2)/2 = n*(n+1)*(2*d*n-2*d+3)/6. - Bruno Berselli, Apr 21 2010
2*a(n) gives the principal diagonal of the convolution array A213819. - Clark Kimberling, Jul 04 2012
Partial sums of the figurate octagonal numbers A000567. For each sequence with a linear recurrence with constant coefficients, the values reduced modulo some constant m generate a periodic sequence. For this sequence, these Pisano periods have length 1, 4, 3, 8, 5, 12, 7, 16, 9, 20, 11, 24, 13, 28, 15, 32, 17, ... for m >= 1. - Ant King, Oct 26 2012
Partial sums of the number of active (ON, black) cells in n-th stage of growth of two-dimensional cellular automaton defined by "Rule 773", based on the 5-celled von Neumann neighborhood. - Robert Price, May 23 2016
On a square grid of side length n+1, the number of embedded rectangles (where each side is greater than 1). For example, in a 2 X 2 square there is one rectangle, in a 3 X 3 square there are nine rectangles, etc. - Peter Woodward, Nov 26 2017
a(n) is the sum of the numbers in the n X n square array A204154(n). - Ali Sada, Jun 21 2019
Sum of all multiples of n and n+1 that are <= n^2. - Wesley Ivan Hurt, May 25 2023

Examples

			a(2) = 9 since there are 9 ways to cover a 4 X 4 lattice with 8 dominoes, 2 of which is horizontal and the other 6 are vertical. - Yong Kong (ykong@curagen.com), May 06 2000
G.f. = x + 9*x^2 + 30*x^3 + 70*x^4 + 135*x^5 + 231*x^6 + 364*x^7 + 540*x^8 + 765*x^9 + ...
		

References

  • A. H. Beiler, Recreations in the Theory of Numbers, Dover, NY, 1964, p. 194.
  • E. Deza and M. M. Deza, Figurate numbers, World Scientific Publishing (2012), page 93.
  • L. E. Dickson, History of the Theory of Numbers. Carnegie Institute Public. 256, Washington, DC, Vol. 1, 1919; Vol. 2, 1920; Vol. 3, 1923, see vol. 2, p. 2.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A093563 (( 6, 1) Pascal, column m=3). A000567 (differences).
Cf. A156927, A157704. - Johannes W. Meijer, Mar 07 2009
Cf. A000326.
Cf. similar sequences listed in A237616.
Cf. A260234 (largest prime factor of a(n+1)).

Programs

  • Magma
    [n*(n+1)*(2*n-1)/2: n in [1..50]]; // Vincenzo Librandi, May 24 2016
  • Maple
    A002414 := n-> 1/2*n*(n+1)*(2*n-1): seq(A002414(n), n=1..100);
  • Mathematica
    LinearRecurrence[{4,-6,4,-1},{1,9,30,70},40] (* Harvey P. Dale, Apr 12 2013 *)
  • PARI
    {a(n) = (2*n - 1) * n * (n + 1) / 2} \\ Michael Somos, Mar 17 2011
    

Formula

a(n) = odd numbers * triangular numbers = (2*n-1)* binomial(n+1,2). - Xavier Acloque, Oct 27 2003
G.f.: x*(1+5*x)/(1-x)^4. [Conjectured by Simon Plouffe in his 1992 dissertation.]
a(n) = A000578(n) + A000217(n-1). - Kieren MacMillan, Mar 19 2007
a(-n) = -A160378(n). - Michael Somos, Mar 17 2011
From Ant King, Oct 26 2012: (Start)
a(n) = a(n-1) + n*(3*n-2).
a(n) = 3*a(n-1) - 3*a(n-2) + a(n-3) + 6.
a(n) = 4*a(n-1) - 6*a(n-2) + 4*a(n-3) - a(n-4).
a(n) = n*A000326(n) - A002411(n-1), see Berselli's comment.
a(n) = (n+1)*(2*A000567(n)+n)/6.
a(n) = A000292(n) + 5*A000292(n-1) = binomial(n+2,3)+5*binomial(n+1,3).
a(n) = A002413(n) + A000292(n-1).
a(n) = A000217(n) + 6*A000292(n-1).
Sum_{n>=1} 1/a(n) = 2*(4*log(2)-1)/3 = 1.1817258148265...
(End)
a(n) = Sum_{i=0..n-1} (n-i)*(6*i+1), with a(0)=0. - Bruno Berselli, Feb 10 2014
E.g.f.: x*(2 + 7*x + 2*x^2)*exp(x)/2. - Ilya Gutkovskiy, May 23 2016
a(n) = A080851(6,n-1). - R. J. Mathar, Jul 28 2016
Sum_{n>=1} (-1)^(n+1)/a(n) = 2*(Pi + 1 - 4*log(2))/3. - Amiram Eldar, Jul 02 2020

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), May 09 2000
Incorrect formula deleted by Ant King, Oct 04 2012

A158825 Square array of coefficients in the successive iterations of x*C(x) = (1-sqrt(1-4*x))/2 where C(x) is the g.f. of the Catalan numbers (A000108); read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 1, 3, 6, 5, 1, 4, 12, 21, 14, 1, 5, 20, 54, 80, 42, 1, 6, 30, 110, 260, 322, 132, 1, 7, 42, 195, 640, 1310, 1348, 429, 1, 8, 56, 315, 1330, 3870, 6824, 5814, 1430, 1, 9, 72, 476, 2464, 9380, 24084, 36478, 25674, 4862, 1, 10, 90, 684, 4200, 19852, 67844, 153306, 199094, 115566, 16796
Offset: 1

Views

Author

Paul D. Hanna, Mar 28 2009, Mar 29 2009

Keywords

Examples

			Square array of coefficients in iterations of x*C(x) begins:
  1,  1,   2,    5,    14,      42,      132,       429,       1430, ... A000108;
  1,  2,   6,   21,    80,     322,     1348,      5814,      25674, ... A121988;
  1,  3,  12,   54,   260,    1310,     6824,     36478,     199094, ... A158826;
  1,  4,  20,  110,   640,    3870,    24084,    153306,     993978, ... A158827;
  1,  5,  30,  195,  1330,    9380,    67844,    500619,    3755156, ... A158828;
  1,  6,  42,  315,  2464,   19852,   163576,   1372196,   11682348, ...;
  1,  7,  56,  476,  4200,   38052,   351792,   3305484,   31478628, ...;
  1,  8,  72,  684,  6720,   67620,   693048,   7209036,   75915708, ...;
  1,  9,  90,  945, 10230,  113190,  1273668,  14528217,  167607066, ...;
  1, 10, 110, 1265, 14960,  180510,  2212188,  27454218,  344320262, ...;
  1, 11, 132, 1650, 21164,  276562,  3666520,  49181418,  666200106, ...;
  1, 12, 156, 2106, 29120,  409682,  5841836,  84218134, 1225314662, ...;
  1, 13, 182, 2639, 39130,  589680,  8999172, 138755799, 2157976392, ...;
  1, 14, 210, 3255, 51520,  827960, 13464752, 221101608, 3660331064, ...;
  1, 15, 240, 3960, 66640, 1137640, 19640032, 342179672, 6007747368, ...;
  1, 16, 272, 4760, 84864, 1533672, 28012464, 516105720, 9578580504, ...;
ILLUSTRATE ITERATIONS.
       Let G(x) = x*C(x), then the first few iterations of G(x) are:
           G(x) = x +   x^2 +  2*x^3 +   5*x^4 +  14*x^5 + ...;
        G(G(x)) = x + 2*x^2 +  6*x^3 +  21*x^4 +  80*x^5 + ...;
     G(G(G(x))) = x + 3*x^2 + 12*x^3 +  54*x^4 + 260*x^5 + ...;
  G(G(G(G(x)))) = x + 4*x^2 + 20*x^3 + 110*x^4 + 640*x^5 + ...;
...
RELATED TRIANGLES.
The g.f. of column n is (g.f. of row n of A158830)/(1-x)^n
where triangle A158830 begins: 1;
      1,       0;
      2,       0,        0;
      5,       1,        0,        0;
     14,      10,        0,        0,       0;
     42,      70,        8,        0,       0,       0;
    132,     424,      160,        4,       0,       0,     0;
    429,    2382,     1978,      250,       1,       0,     0,   0;
   1430,   12804,    19508,     6276,     302,       0,     0,   0, 0;
   4862,   66946,   168608,   106492,   15674,     298,     0,   0, 0, 0;
  16796,  343772,  1337684,  1445208,  451948,   33148,   244,   0, 0, 0, 0;
  58786, 1744314, 10003422, 16974314, 9459090, 1614906, 61806, 162, 0, 0, 0, 0;
  ...
Triangle A158835 transforms one diagonal into the next:
       1;
       1,      1;
       4,      2,     1;
      27,     11,     3,    1;
     254,     94,    21,    4,   1;
    3062,   1072,   217,   34,   5,  1;
   45052,  15212,  2904,  412,  50,  6, 1;
  783151, 257777, 47337, 6325, 695, 69, 7, 1; ...
so that:
  A158835 * A158831 = A158832;
  A158835 * A158832 = A158833;
  A158835 * A158833 = A158834;
where the diagonals start:
  A158831 = [1, 1,  6,  54,  640,  9380,  163576,  3305484, ...];
  A158832 = [1, 2, 12, 110, 1330, 19852,  351792,  7209036, ...];
  A158833 = [1, 3, 20, 195, 2464, 38052,  693048, 14528217, ...];
  A158834 = [1, 4, 30, 315, 4200, 67620, 1273668, 27454218, ...].
		

Crossrefs

Antidiagonal sums: A158829.
Related triangles: A158830, A158835.
Variant: A122888.

Programs

  • Mathematica
    Clear[row]; nmax = 12;
    row[n_]:= row[n]= CoefficientList[Nest[(1-Sqrt[1-4#])/2&, x, n] + O[x]^(nmax+1), x] //Rest;
    T[n_, k_]:= row[n][[k]];
    Table[T[n-k+1, k], {n, nmax}, {k, n}]//Flatten (* Jean-François Alcover, Jul 13 2018, updated Aug 09 2018 *)
  • PARI
    {T(n,k)= local(F=serreverse(x-x^2+O(x^(k+2))), G=x);
    for(i=1, n, G=subst(F,x,G)); polcoeff(G,k)}

Formula

G.f. of column n = (g.f. of row n of A158830)/(1-x)^n.
Row k equals the first column of the k-th matrix power of Catalan triangle A033184; thus triangle A033184 transforms row n into row n+1 of this array (A158825). - Paul D. Hanna, Mar 30 2009
From G. C. Greubel, Apr 01 2021: (Start)
T(n, 1) = A000012(n), T(n, 2) = A000027(n).
T(n, 3) = A002378(n), T(n, 4) = A160378(n+1). (End)

A264909 Number A(n,k) of k-ascent sequences of length n with no consecutive repeated letters; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 2, 2, 0, 1, 1, 3, 6, 5, 0, 1, 1, 4, 12, 21, 16, 0, 1, 1, 5, 20, 54, 87, 61, 0, 1, 1, 6, 30, 110, 276, 413, 271, 0, 1, 1, 7, 42, 195, 670, 1574, 2213, 1372, 0, 1, 1, 8, 56, 315, 1380, 4470, 9916, 13205, 7795, 0
Offset: 0

Views

Author

Alois P. Heinz, Nov 28 2015

Keywords

Examples

			Square array A(n,k) begins:
  1,   1,    1,    1,     1,     1,      1,      1, ...
  1,   1,    1,    1,     1,     1,      1,      1, ...
  0,   1,    2,    3,     4,     5,      6,      7, ...
  0,   2,    6,   12,    20,    30,     42,     56, ...
  0,   5,   21,   54,   110,   195,    315,    476, ...
  0,  16,   87,  276,   670,  1380,   2541,   4312, ...
  0,  61,  413, 1574,  4470, 10555,  21931,  41468, ...
  0, 271, 2213, 9916, 32440, 86815, 201761, 422128, ...
		

Crossrefs

Rows k=0+1,2-4 give: A000012, A001477, A002378, A160378(n+1).
Main diagonal gives A264916.

Programs

  • Maple
    b:= proc(n, k, i, t) option remember; `if`(n<1, 1, add(
          `if`(j=i, 0, b(n-1, k, j, t+`if`(j>i, 1, 0))), j=0..t+k))
        end:
    A:= (n, k)-> b(n-1, k, 0$2):
    seq(seq(A(n, d-n), n=0..d), d=0..12);
  • Mathematica
    b[n_, k_, i_, t_] := b[n, k, i, t] = If[n<1, 1, Sum[If[j == i, 0, b[n-1, k, j, t + If[j>i, 1, 0]]], {j, 0, t+k}]]; A[n_, k_] := b[n-1, k, 0, 0]; Table[Table[A[n, d-n], {n, 0, d}], {d, 0, 12}] // Flatten (* Jean-François Alcover, Feb 17 2016, after Alois P. Heinz *)

A267232 T(n,k)=Number of length-n 0..k arrays with no following elements greater than or equal to the first repeated value.

Original entry on oeis.org

2, 3, 4, 4, 9, 5, 5, 16, 21, 6, 6, 25, 54, 47, 7, 7, 36, 110, 176, 103, 8, 8, 49, 195, 470, 564, 223, 9, 9, 64, 315, 1030, 1980, 1790, 479, 10, 10, 81, 476, 1981, 5375, 8274, 5646, 1023, 11, 11, 100, 684, 3472, 12327, 27854, 34396, 17732, 2175, 12, 12, 121, 945, 5676
Offset: 1

Views

Author

R. H. Hardin, Jan 12 2016

Keywords

Comments

Table starts
..2....3......4.......5........6.........7.........8..........9.........10
..4....9.....16......25.......36........49........64.........81........100
..5...21.....54.....110......195.......315.......476........684........945
..6...47....176.....470.....1030......1981......3472.......5676.......8790
..7..103....564....1980.....5375.....12327.....25088......46704......81135
..8..223...1790....8274....27854.....76237....180292.....382404.....745548
..9..479...5646...34396...143695....469623...1291052....3121008....6830757
.10.1023..17732..142474...738990...2884909...9222184...25415028...62455218
.11.2175..55512..588596..3791775..17686215..65755592..206617680..570177387
.12.4607.173354.2426738.19421854.108259885.468196540.1677626052.5199327816

Examples

			Some solutions for n=6 k=4
..3....3....1....0....4....0....3....2....4....2....4....4....4....1....0....1
..1....4....4....2....4....2....1....0....3....3....2....3....1....4....1....2
..0....2....4....0....2....0....0....3....4....2....1....0....0....3....3....0
..2....0....3....4....2....3....1....2....4....2....2....1....3....2....0....2
..4....2....1....0....1....1....4....3....1....1....0....4....0....1....3....0
..4....1....0....4....2....2....4....2....0....1....2....4....2....4....2....3
		

Crossrefs

Column 1 is A000027(n+2).
Row 1 is A000027(n+1).
Row 2 is A000290(n+1).
Row 3 is A160378(n+1).

Formula

Empirical for column k:
k=1: a(n) = 2*a(n-1) -a(n-2) for n>3
k=2: a(n) = 5*a(n-1) -8*a(n-2) +4*a(n-3) for n>4
k=3: a(n) = 9*a(n-1) -29*a(n-2) +39*a(n-3) -18*a(n-4) for n>5
k=4: a(n) = 14*a(n-1) -75*a(n-2) +190*a(n-3) -224*a(n-4) +96*a(n-5) for n>6
k=5: [order 6] for n>7
k=6: [order 7] for n>8
k=7: [order 8] for n>9
Empirical for row n:
n=1: a(n) = n + 1
n=2: a(n) = n^2 + 2*n + 1
n=3: a(n) = n^3 + (5/2)*n^2 + (3/2)*n
n=4: a(n) = n^4 + (17/6)*n^3 + 2*n^2 + (1/6)*n
n=5: a(n) = n^5 + (37/12)*n^4 + (5/2)*n^3 + (5/12)*n^2
n=6: a(n) = n^6 + (197/60)*n^5 + 3*n^4 + (3/4)*n^3 - (1/30)*n
n=7: a(n) = n^7 + (69/20)*n^6 + (7/2)*n^5 + (7/6)*n^4 - (7/60)*n^2

A144650 Triangle read by rows where T(m,n) = 2m*n + m + n + 1.

Original entry on oeis.org

5, 8, 13, 11, 18, 25, 14, 23, 32, 41, 17, 28, 39, 50, 61, 20, 33, 46, 59, 72, 85, 23, 38, 53, 68, 83, 98, 113, 26, 43, 60, 77, 94, 111, 128, 145, 29, 48, 67, 86, 105, 124, 143, 162, 181, 32, 53, 74, 95, 116, 137, 158, 179, 200, 221, 35, 58, 81, 104, 127, 150, 173, 196, 219, 242, 265
Offset: 1

Views

Author

Vincenzo Librandi, Jan 13 2009

Keywords

Comments

First column: A016789, second column: A016885, third column: A017029, fourth column: A017221, fifth column: A017461. - Vincenzo Librandi, Nov 21 2012

Examples

			Triangle begins:
   5;
   8, 13;
  11, 18, 25;
  14, 23, 32, 41;
  17, 28, 39, 50,  61;
  20, 33, 46, 59,  72,  85;
  23, 38, 53, 68,  83,  98, 113;
  26, 43, 60, 77,  94, 111, 128, 145;
  29, 48, 67, 86, 105, 124, 143, 162, 181;
  32, 53, 74, 95, 116, 137, 158, 179, 200, 221; etc.
		

Crossrefs

Columns k: A016789 (k=1), A016885 (k=2), A017029 (k=3), A017221 (k=4), A017461 (k=5).

Programs

  • Magma
    [2*n*k + n + k + 1: k in [1..n], n in [1..11]]; // Vincenzo Librandi, Nov 21 2012
    
  • Mathematica
    T[n_,k_]:= 2 n*k + n + k + 1; Table[T[n, k], {n, 11}, {k, n}]//Flatten (* Vincenzo Librandi, Nov 21 2012 *)
  • SageMath
    flatten([[2*n*k+n+k+1 for k in range(1,n+1)] for n in range(1,13)]) # G. C. Greubel, Oct 14 2023

Formula

Sum_{n=1..m} T(m, n) = m*(2*m+3)*(m+1)/2 = A160378(n+1) (row sums). - R. J. Mathar, Jan 15 2009, Jan 05 2011
From G. C. Greubel, Oct 14 2023: (Start)
T(n, n) = A001844(n).
T(n, n-1) = A001105(n), n >= 2.
T(n, n-2) = A142463(n-1), n >= 3.
T(n, n-3) = (-1)*A147973(n+2), n >= 4.
Sum_{k=1..n} (-1)^k*T(n, k) = (-1)^n*A007742(floor((n+1)/2)).
G.f.: x*y*(5 - 2*x - 2*x*y - 2*x^2*y + x^2*y^2)/((1-x)^2*(1-x*y)^3). (End)

A135713 a(n) = n*(n+1)*(4*n+1)/2.

Original entry on oeis.org

0, 5, 27, 78, 170, 315, 525, 812, 1188, 1665, 2255, 2970, 3822, 4823, 5985, 7320, 8840, 10557, 12483, 14630, 17010, 19635, 22517, 25668, 29100, 32825, 36855, 41202, 45878, 50895, 56265, 62000, 68112, 74613, 81515, 88830, 96570, 104747, 113373, 122460, 132020
Offset: 0

Views

Author

N. J. A. Sloane, Mar 05 2008

Keywords

Comments

This sequence is related to A045944 by a(n) = n*A045944(n)-Sum_{i=0..n-1} A045944(i); this is the case d=6 in the identity n^2*(d*n+d-2)/2 - sum(k*(d*k+d-2)/2, k=0..n-1) = n*(n+1)*(2*d*n+d-3)/6 . - Bruno Berselli, Nov 19 2010
Bisection (even part) of A002717. See the Conway and Guy reference. - Wolfdieter Lang, Apr 16 2020

References

  • J. H. Conway and R. K. Guy, The Book of Numbers, p. 83.

Crossrefs

Bisection of A002717 (even part).

Programs

  • Magma
    [n*(n+1)*(4*n+1)/2: n in [0..40]];  // Bruno Berselli, Aug 23 2011
  • Mathematica
    LinearRecurrence[{4,-6,4,-1}, {0, 5, 27, 78}, 50] (* Vincenzo Librandi, Mar 01 2012 *)
    Table[n*(n+1)*(4*n+1)/2,{n,0,25}] (* G. C. Greubel, Oct 29 2016 *)
    Table[PolygonalNumber[n](4n+1),{n,0,40}] (* Harvey P. Dale, Apr 26 2025 *)

Formula

O.g.f.: x*(7*x+5)/(x-1)^4. - R. J. Mathar, Apr 22 2008.
a(n) = 4*a(n-1) -6*a(n-2) +4*a(n-3) -a(n-4) for n>3. - Bruno Berselli, Nov 19 2010
a(-n-1) = -A051895(n). - Bruno Berselli, Aug 23 2011
E.g.f.: (1/2)*x*(10 + 17*x + 4*x^2)*exp(x). - G. C. Greubel, Oct 29 2016
Sum_{n>=1} 1/a(n) = 2*(5 - 2*Pi/3 - 4*log(2)) = 0.26603235073404654... - Ilya Gutkovskiy, Oct 29 2016

A163815 a(n) = n*(2*n^2 + 5*n + 3).

Original entry on oeis.org

0, 10, 42, 108, 220, 390, 630, 952, 1368, 1890, 2530, 3300, 4212, 5278, 6510, 7920, 9520, 11322, 13338, 15580, 18060, 20790, 23782, 27048, 30600, 34450, 38610, 43092, 47908, 53070, 58590, 64480, 70752, 77418, 84490, 91980, 99900, 108262, 117078, 126360, 136120
Offset: 0

Views

Author

Vincenzo Librandi, Aug 04 2009

Keywords

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[2*x*(5+x)/(x-1)^4, {x, 0, 40}], x] (* or *) LinearRecurrence[{4, -6, 4, -1}, {0, 10, 42, 108}, 50](* Vincenzo Librandi, Mar 06 2012 *)
  • PARI
    x='x+O('x^50); concat([0], Vec(2*x*(5+x)/(x-1)^4)) \\ G. C. Greubel, Aug 04 2017

Formula

Row sums from A155151: a(n) = Sum_{m=1..n} 2*(2*m*n + m + n + 1).
a(n) = 2*A160378(n+1).
G.f.: 2*x*(5+x)/(x-1)^4.
a(n) = 4*a(n-1) -6*a(n-2) +4*a(n-3) -a(n-4).
E.g.f.: (2*x^3 + 11*x^2 + 10*x)*exp(x). - G. C. Greubel, Aug 04 2017

Extensions

Edited and a(4) corrected by R. J. Mathar, Aug 05 2009

A361226 Square array T(n,k) = k*((1+2*n)*k - 1)/2; n>=0, k>=0, read by antidiagonals upwards.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 0, 2, 5, 3, 0, 3, 9, 12, 6, 0, 4, 13, 21, 22, 10, 0, 5, 17, 30, 38, 35, 15, 0, 6, 21, 39, 54, 60, 51, 21, 0, 7, 25, 48, 70, 85, 87, 70, 28, 0, 8, 29, 57, 86, 110, 123, 119, 92, 36, 0, 9, 33, 66, 102, 135, 159, 168, 156, 117, 45
Offset: 0

Views

Author

Paul Curtz, Mar 05 2023

Keywords

Comments

The main diagonal is A002414.
The first upper diagonal is A160378(n+1).
The antidiagonals sums are A034827(n+2).
b(n) = (A034827(n+3) = 0, 2, 10, 30, 70, ...) - (A002414(n) = 0, 1, 9, 30, 70, ...) = 0, 1, 1, 0, 0, 5, 21, 56, ... .
b(n+2) = A299120(n). b(n+4) = A033275(n). b(n+4) - b(n) = A002492(n).

Examples

			The rows are
  0, 0,  1,  3,  6,  10,  15,  21, ...   = A161680
  0, 1,  5, 12, 22,  35,  51,  70, ...   = A000326
  0, 2,  9, 21, 38,  60,  87, 119, ...   = A005476
  0, 3, 13, 30, 54,  85, 123, 168, ...   = A022264
  0, 4, 17, 39, 70, 110, 159, 217, ...   = A022266
  ... .
Columns: A000004, A001477, A016813, A017197=3*A016777, 2*A017101, 5*A016873, 3*A017581, 7*A017017, ... (coefficients from A026741).
Difference between two consecutive rows: A000290. Hence A143844.
This square array read by antidiagonals leads to the triangle
  0
  0   0
  0   1   1
  0   2   5   3
  0   3   9  12   6
  0   4  13  21  22  10
  0   5  17  30  38  35  15
  ... .
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := k*((2*n + 1)*k - 1)/2; Table[T[n - k, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Amiram Eldar, Mar 05 2023 *)
  • PARI
    a(n) = { my(row = (sqrtint(8*n+1)-1)\2, column = n - binomial(row + 1, 2)); binomial(column, 2) + column^2 * (row - column) } \\ David A. Corneth, Mar 05 2023
    
  • Python
    # Seen as a triangle:
    from functools import cache
    @cache
    def Trow(n: int) -> list[int]:
        if n == 0: return [0]
        r = Trow(n - 1)
        return [r[k] + k * k if k < n else r[n - 1] + n - 1 for k in range(n + 1)]
    for n in range(7): print(Trow(n)) # Peter Luschny, Mar 05 2023

Formula

Take successively sequences n*(n-1)/2, n*(3*n-1)/2, n*(5*n-1)/2, ... listed in the EXAMPLE section.
G.f.: y*(x + y)/((1 - y)^3*(1 - x)^2). - Stefano Spezia, Mar 06 2023
E.g.f.: exp(x+y)*y*(2*x + y + 2*x*y)/2. - Stefano Spezia, Feb 21 2024

A380790 Length of the n-th Golomb ruler constructed by the Paul Erdős and Pál Turán formula.

Original entry on oeis.org

20, 110, 308, 1254, 2106, 4760, 6650, 11822, 23954, 29202, 49950, 68060, 78518, 102460, 147446, 203432, 225090, 298418, 354858, 386316, 489484, 568052, 700964, 907920, 1025150, 1086856, 1218944, 1289034, 1436456, 2039620, 2238790, 2561900, 2675472, 3296774, 3430418
Offset: 2

Views

Author

Darío Clavijo, Feb 03 2025

Keywords

Comments

In October of 1941 Paul Erdős and Pál Turán found that a Golomb ruler could be constructed for every odd prime p.
Such a ruler has the property that the mark or notches are defined by: notch(k) = 2pk + (k^2 mod p) for k in {0..p-1}, with p=A000040(n).
Empirical observation: a(n) satisfies p^3-p^2 <= a(n)/p^3 <= 0.9999.
Except for n=2, a(n) is divisible by p.
Also partial sums of A217793.

Examples

			 n | p  | Golomb ruler notches                             | a(n)
---+----+--------------------------------------------------+-------
 2 | 3  | 0, 7,  13                                        | 20
 3 | 5  | 0, 11, 24, 34, 41                                | 110
 4 | 7  | 0, 15, 32, 44, 58, 74,  85                       | 308
 5 | 11 | 0, 23, 48, 75, 93, 113, 135, 159, 185, 202, 221  | 1254
		

Crossrefs

Programs

  • PARI
    a(n)= if(n==2, return(20));  my(p=prime(n)); if(bitand(p, 3)==1, return((p*(p-1)*(2*p+1))/2)); if(bitand(p, 3)==3, return((p*(p-1)*(2*p+1))/2 - p * qfbclassno(-p)));
  • Python
    from sympy import prime
    from math import isqrt
    def a(n):
      p = prime(n)
      if p & 3 == 1: return (p*(p-1)*(2*p+1))//2
      m = isqrt(p-1)
      return (p-1) * p**2 + (m*(m+1)*(2*m+1))//6 + sum(pow(k,2,p) for k in range(m+1,p))
    print([a(n) for n in range(2, 37) ])
    

Formula

a(n) = Sum_{k=0..p-1} (2*k*p + k^2 mod p), where p is the n-th prime.
a(n) = (p-1)*p^2 + 1 + Sum_{k=2..p-1} (k^2 mod p), where p is the n-th prime.
a(n) = (p-1)*p^2 + A000330(m) + Sum_{k=m+1..p-1} (k^2 mod p), where m = floor(sqrt(p-1)) and p is the n-th prime.
a(n) = (p-1)*p^2 + p*(p-1)*(p+1)/12 - 2*p*(Sum_{k=1..(p-1)/2} floor(k^2/p)), where p is the n-th prime.
a(n) = A100104(A000040(n)) + A048153(A000040(n)) - 1.
a(n) = A100104(A000040(n)) + A076409(n).
a(n) = A160378(A000040(n)), iif A000040(n) = 1 (mod 4).
a(n) = A160378(A000040(n)) - A000040(n)*A355879(n), iif A000040(n) = 3 (mod 4).
a(n) < A000040(n)^3.
a(n) > A000040(n)^3 - A000040(n)^2.
a(n) = 0 mod A000040(n) for n >= 3.
a(n) = Sum_{k=0..A000040(n)-1} A217793(n - 1, k).
a(n) = A135177(n) + A127921(n) - 2*p*(Sum_{k=1..(p-1)/2} floor(k^2/p)), where p = A000040(n).
Showing 1-9 of 9 results.