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

A087189 (P(p)-1)/2/p^2 where p runs through the odd primes different from 5 and P(k) is the k-th central pentanomial coefficient (A005191).

Original entry on oeis.org

1, 83, 16907, 279021, 89444018, 1695011087, 658067703933, 5768410509553937, 122108313460051500, 1226978854222034501448, 593538703869555995238872, 13175226571428140572866093, 6594852118968926152838341468, 76339779380132942579800334346403
Offset: 1

Views

Author

Benoit Cloitre, Oct 19 2003

Keywords

Crossrefs

Cf. A005191.

Programs

  • Mathematica
    f[n_] := Max[CoefficientList[Expand[Sum[x^k, {k, 0, 4}]^n], x]]; Table[(f[p] - 1)/(2*p^2), {p, Prime[Delete[Range[2, 15], 2]]}] (* Amiram Eldar, Apr 22 2025 *)
  • PARI
    A087189(n) = local(p=prime(n+2-(n==1))); (A005191(p)-1)/2/p^2 \\ M. F. Hasler, Jul 23 2007

Extensions

Corrected and extended by M. F. Hasler, Jul 23 2007

A077042 Square array read by falling antidiagonals of central polynomial coefficients: largest coefficient in expansion of (1 + x + x^2 + ... + x^(n-1))^k = ((1-x^n)/(1-x))^k, i.e., the coefficient of x^floor(k*(n-1)/2) and of x^ceiling(k*(n-1)/2); also number of compositions of floor(k*(n+1)/2) into exactly k positive integers each no more than n.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 2, 1, 1, 0, 1, 3, 3, 1, 1, 0, 1, 6, 7, 4, 1, 1, 0, 1, 10, 19, 12, 5, 1, 1, 0, 1, 20, 51, 44, 19, 6, 1, 1, 0, 1, 35, 141, 155, 85, 27, 7, 1, 1, 0, 1, 70, 393, 580, 381, 146, 37, 8, 1, 1, 0, 1, 126, 1107, 2128, 1751, 780, 231, 48, 9, 1, 1, 0, 1, 252, 3139
Offset: 0

Views

Author

Henry Bottomley, Oct 22 2002

Keywords

Comments

From Michel Marcus, Dec 01 2012: (Start)
A pair of numbers written in base n are said to be comparable if all digits of the first number are at least as big as the corresponding digit of the second number, or vice versa. Otherwise, this pair will be defined as uncomparable. A set of pairwise uncomparable integers will be called anti-hierarchic.
T(n,k) is the size of the maximal anti-hierarchic set of integers written with k digits in base n.
For example, for base n=2 and k=4 digits:
- 0 (0000) and 15 (1111) are comparable, while 6 (0110) and 9 (1001) are uncomparable,
- the maximal antihierarchic set is {3 (0011), 5 (0101), 6 (0110), 9 (1001), 10 (1010), 12 (1100)} with 6 elements that are all pairwise uncomparable. (End)

Examples

			Rows of square array start:
  1,    0,    0,    0,    0,    0,    0, ...
  1,    1,    1,    1,    1,    1,    1, ...
  1,    1,    2,    3,    6,   10,   20, ...
  1,    1,    3,    7,   19,   51,  141, ...
  1,    1,    4,   12,   44,  155,  580, ...
  1,    1,    5,   19,   85,  381, 1751, ...
  ...
Read by antidiagonals:
  1;
  0, 1;
  0, 1, 1;
  0, 1, 1, 1;
  0, 1, 2, 1, 1;
  0, 1, 3, 3, 1, 1;
  0, 1, 6, 7, 4, 1, 1;
  ...
		

Crossrefs

Programs

Formula

By the central limit theorem, T(n,k) is roughly n^(k-1)*sqrt(6/(Pi*k)).
T(n,k) = Sum{j=0,h/n} (-1)^j*binomial(k,j)*binomial(k-1+h-n*j,k-1) with h=floor(k*(n-1)/2), k>0. - Michel Marcus, Dec 01 2012

A201552 Square array read by diagonals: T(n,k) = number of arrays of n integers in -k..k with sum equal to 0.

Original entry on oeis.org

1, 1, 3, 1, 5, 7, 1, 7, 19, 19, 1, 9, 37, 85, 51, 1, 11, 61, 231, 381, 141, 1, 13, 91, 489, 1451, 1751, 393, 1, 15, 127, 891, 3951, 9331, 8135, 1107, 1, 17, 169, 1469, 8801, 32661, 60691, 38165, 3139, 1, 19, 217, 2255, 17151, 88913, 273127, 398567, 180325, 8953, 1
Offset: 1

Views

Author

R. H. Hardin, Dec 02 2011

Keywords

Comments

Equivalently, the number of compositions of n*(k + 1) into n parts with maximum part size 2*k+1. - Andrew Howroyd, Oct 14 2017

Examples

			Some solutions for n=7, k=3:
..1...-2....1...-1....1...-3....0....0....1....2....3...-3....0....2....1....0
.-1....2...-2....2....2....2...-1....0....2....2...-2...-1...-2...-1....2...-1
.-3...-1....1...-3....2....1....0....1....3....0....2....0...-1....2...-2...-1
..0....3....3....3...-2...-2....3....3...-3...-3....0...-1...-1...-1....0....3
..2...-1...-1...-1...-3....0...-3...-2....1...-1...-1....1....1....0....3...-1
..2...-1...-3....0....2....3....0....1...-2....1....1....1....3...-2...-3...-3
.-1....0....1....0...-2...-1....1...-3...-2...-1...-3....3....0....0...-1....3
Table starts:
.   1,      1,       1,        1,        1,         1,...
.   3,      5,       7,        9,       11,        13,...
.   7,     19,      37,       61,       91,       127,...
.  19,     85,     231,      489,      891,      1469,...
.  51,    381,    1451,     3951,     8801,     17151,...
. 141,   1751,    9331,    32661,    88913,    204763,...
. 393,   8135,   60691,   273127,   908755,   2473325,...
.1107,  38165,  398567,  2306025,  9377467,  30162301,...
.3139, 180325, 2636263, 19610233, 97464799, 370487485,...
		

Crossrefs

Programs

  • Maple
    seq(print(seq(add((-1)^i*binomial(n, i)*binomial((k+1)*n-(2*k+1)*i-1, n-1), i = 0..floor((1/2)*n)), k = 1..10)), n = 1..10); # Peter Bala, Oct 16 2024
  • Mathematica
    comps[r_, m_, k_] := Sum[(-1)^i*Binomial[r - 1 - i*m, k - 1]*Binomial[k, i], {i, 0, Floor[(r - k)/m]}];  T[n_, k_] := comps[n*(k + 1), 2*k + 1, n]; Table[T[n - k + 1, k], {n, 1, 11}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Oct 31 2017, after Andrew Howroyd *)
  • PARI
    comps(r, m, k)=sum(i=0, floor((r-k)/m), (-1)^i*binomial(r-1-i*m, k-1)*binomial(k, i));
    T(n,k) = comps(n*(k+1), 2*k+1, n); \\ Andrew Howroyd, Oct 14 2017

Formula

Empirical: T(n,k) = Sum_{i=0..floor(k*n/(2*k+1))} (-1)^i*binomial(n,i)* binomial((k+1)*n-(2*k+1)*i-1,n-1).
The above empirical formula is true and can be derived from the formula for the number of compositions with given number of parts and maximum part size. - Andrew Howroyd, Oct 14 2017
Empirical for rows:
T(1,k) = 1
T(2,k) = 2*k + 1
T(3,k) = 3*k^2 + 3*k + 1
T(4,k) = (16/3)*k^3 + 8*k^2 + (14/3)*k + 1
T(5,k) = (115/12)*k^4 + (115/6)*k^3 + (185/12)*k^2 + (35/6)*k + 1
T(6,k) = (88/5)*k^5 + 44*k^4 + 46*k^3 + 25*k^2 + (37/5)*k + 1
T(7,k) = (5887/180)*k^6 + (5887/60)*k^5 + (2275/18)*k^4 + (357/4)*k^3 + (6643/180)*k^2 + (259/30)*k + 1
T(m,k) = (1/Pi)*integral_{x=0..Pi} (sin((k+1/2)x)/sin(x/2))^m dx; for the proof see Dirichlet Kernel link; so f(m,n) = (1/Pi)*integral_{x=0..Pi} (Sum_{k=-n..n} exp(I*k*x))^m dx = sum(integral(exp(I(k_1+...+k_m).x),x=0..Pi)/Pi,{k_1,...,k_m=-n..n}) = sum(delta_0(k1+...+k_m),{k_1,...,k_m=-n..n}) = number of arrays of m integers in -n..n with sum zero. - Yalcin Aktar, Dec 03 2011
T(n, k) = the constant term in the expansion of (x^(-k) + ... + x^(-1) + 1 + x + ... + x^k)^n = the coefficient of x^(k*n) (i.e., the central coefficient) in the expansion of (1 + x + ... + x^(2*k))^n = the coefficient of x^(k*n) in the expansion of ( (1 - x^(2*k+1))/(1 - x) )^n. Expanding the binomials and collecting terms gives the empirical formula above. - Peter Bala, Oct 16 2024

A187925 Coefficient of x^n in (1+x+x^2+x^3+x^4)^n.

Original entry on oeis.org

1, 1, 3, 10, 35, 121, 426, 1520, 5475, 19855, 72403, 265233, 975338, 3598180, 13311000, 49360405, 183424355, 682870587, 2546441085, 9509714340, 35561166195, 133138728845, 499005557515, 1872137642125, 7030166054250, 26421479140746, 99376657487396
Offset: 0

Views

Author

Emanuele Munarini, Mar 16 2011

Keywords

Crossrefs

Column k=4 of A305161.

Programs

  • Magma
    P:=PolynomialRing(Integers()); [Coefficients((1+x+x^2+x^3+x^4)^n)[n+1]: n in [0..26]]; // Vincenzo Librandi, Aug 09 2014
    
  • Mathematica
    Pentanomial[n_, k_] := If[k == 0, 1, Coefficient[(1 + x + x^2 + x^3 + x^4)^n, x^k]]
    Table[Pentanomial[n, n], {n, 0, 12}]
  • Maxima
    pentanomial(n,k):=coeff(expand((1+x+x^2+x^3+x^4)^n),x,k);
    makelist(pentanomial(n,n),n,0,12);
    
  • Maxima
    a(n):=sum(binomial(n,r)*sum((sum(binomial(j,-r+n-m-j)*binomial(m,j),j,0,m))*binomial(r,m),m,0,r),r,0,n); /* Vladimir Kruchinin, Feb 03 2013 */
    
  • Maxima
    a(n):=sum((-1)^i*binomial(n,i)*binomial(2*n-5*i-1,n-5*i),i,0,n/5); /* Vladimir Kruchinin, Mar 28 2019 */
    
  • PARI
    a(n) = polcoeff((1+x+x^2+x^3+x^4)^n, n); \\ Michel Marcus, Aug 09 2014

Formula

a(n) = sum(r=0..n, binomial(n,r)*sum(m=0..r, (sum(j=0..m, binomial(j,-r+n-m-j)*binomial(m,j)))*binomial(r,m))). [Vladimir Kruchinin, Feb 03 2013]
G.f.: 1 + x*G'(x)/G(x) where G(x) is the g.f. of A036766. - Paul D. Hanna, Feb 03 2013
Recurrence: 3*n*(3*n-2)*(3*n-1)*(748*n^3 - 4136*n^2 + 7291*n - 4135)*a(n) = 2*(35156*n^6 - 247126*n^5 + 663756*n^4 - 870079*n^3 + 584710*n^2 - 190393*n + 23280)*a(n-1) + 5*(n-1)*(2244*n^5 - 14652*n^4 + 32367*n^3 - 28501*n^2 + 8564*n - 672)*a(n-2) + 100*(n-2)*(n-1)*(374*n^4 - 1881*n^3 + 2848*n^2 - 1475*n + 222)*a(n-3) + 125*(n-3)*(n-2)*(n-1)*(748*n^3 - 1892*n^2 + 1263*n - 232)*a(n-4). - Vaclav Kotesovec, Feb 11 2015
a(n) ~ c * d^n / sqrt(n), where d = 3.83443724902880556376524112660950145464... is the root of the equation -125-50*d-15*d^2-94*d^3+27*d^4 = 0, c = 0.3404440985692437948910444085315314358395... . - Vaclav Kotesovec, Feb 11 2015
a(n) = Sum_{i=0..n/5} (-1)^i*C(n,i)*C(2*n-5*i-1,n-5*i). - Vladimir Kruchinin, Mar 28 2019
From Peter Bala, Mar 31 2020: (Start)
a(p) == 1 (mod p^2) for any prime p > 5 (follows from Kruchinin's formula above). Cf. A002426. More generally, we may have a(p^k) == a(p^(k-1)) (mod p^(2*k)) for k >= 2 and any prime p.
The sequence b(n) := [x^n] ( F(x)/F(-x) )^n = [x^n] ( F(x)^2/F(x^2) )^n, where F(x) = 1 + x + x^2 + x^3 + x^4, may satisfy the stronger congruences b(p) == 2 (mod p^3) for prime p > 5 (checked up to p = 499). (End)

A201803 T(n,k)=Number of zero-sum nXk -2..2 arrays with every element unequal to at most two horizontal and vertical neighbors.

Original entry on oeis.org

1, 5, 5, 19, 85, 19, 85, 455, 455, 85, 381, 3617, 4057, 3617, 381, 1751, 28625, 48335, 48335, 28625, 1751, 8135, 235827, 562961, 988589, 562961, 235827, 8135, 38165, 1972115, 7099021, 20960485, 20960485, 7099021, 1972115, 38165, 180325, 16703881
Offset: 1

Views

Author

R. H. Hardin Dec 05 2011

Keywords

Comments

Table starts
......1.........5.........19..........85.........381........1751..........8135
......5........85........455........3617.......28625......235827.......1972115
.....19.......455.......4057.......48335......562961.....7099021......90062519
.....85......3617......48335......988589....20960485...472565771...10857153407
....381.....28625.....562961....20960485...722587629.27941324053.1077779765471
...1751....235827....7099021...472565771.27941324053
...8135...1972115...90062519.10857153407
..38165..16703881.1168520339
.180325.142672901
.856945

Examples

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

Crossrefs

Column 1 is A005191

A063419 Central sextinomial coefficients.

Original entry on oeis.org

1, 6, 146, 4332, 135954, 4395456, 144840476, 4836766584, 163112472594, 5542414273884, 189456975899496, 6507792553644256, 224442843729333276, 7766945604528200460, 269557528994032024080, 9378595792117360310832
Offset: 0

Views

Author

Wolfdieter Lang, Jul 24 2001

Keywords

Comments

Largest coefficient of (Sum_{j=0..5} x^j)^(2*n). a(n)= A018901(2*n).
The exponent of 2 in prime factorization of a(n) for n=1,2,...,7 is in A023520. - Roman Witula, Oct 07 2012
Central coefficients in triangle A063260. - Zagros Lalo, Sep 25 2018

References

  • Shara Lalo and Zagros Lalo, Polynomial Expansion Theorems and Number Triangles, Zana Publishing, 2018, ISBN: 978-1-9995914-0-3, pp. 605, 606.
  • R. Witula and D. Slota, Central trinomial coefficients and convolution type identities, Congressus Numerantium 201 (2010), 109-126.

Crossrefs

Central q-nomial coefficients (appearing once) for q=2..5: A000984, A002426, A005721, A005191. For q=7: A025012.
Cf. A063260.

Programs

  • GAP
    Concatenation([1],List([1..15],n->Sum([0..Int(5*n/6)],k->(-1)^k*Binomial(2*n,k)*Binomial(7*n-6*k-1,2*n-1)))); # Muniru A Asiru, Sep 26 2018
  • Mathematica
    Table[Sum[(-1)^k*Binomial[2*n, k]*Binomial[7*n - 6*k - 1, 2*n - 1], {k, 0, Floor[5*n/6]}], {n, 0, 50}] (* G. C. Greubel, Mar 02 2017 *)
  • PARI
    concat([1], for(n=1,25, print1(sum(k=0,floor(5*n/6),(-1)^(k)*binomial(2*n,k)* binomial(7*n-6*k-1, 2*n-1)), ", "))) \\ G. C. Greubel, Mar 02 2017
    

Formula

a(n) = A063260(2*n, 5*n)= [x^(5*n)](Sum_{j=0..5} x^j)^(2*n).
a(n) = Sum_{k=0..floor(5*n/6)} ((-1)^(k)*binomial(2*n,k)*binomial(7*n-6*k-1, 2*n-1)). - Warut Roonguthai, May 22 2006
2*Pi*a(n) = Integral[-Pi;Pi] (sin(6*x)/sin(x))^(2*n) dx. The proof of this fact is in the Witula/Slota paper. - Roman Witula, Oct 07 2012
The Almkvist-Zeilberger algorithm in EKHAD establishes the following recurrence: -31104*(2*n+5)*(2*n+3)*(2*n+1)*(7*n+19)*(5*n+11)*(7*n+20)*(7*n+13)*(n+2)*(n+1)*a(n)+ 864*(7*n+20)*(2*n+5)*(2*n+3)*(n+2)*(25480*n^5+ 223496*n^4+755066*n^3+1223233*n^2+946889*n+279936)*a(n+1)- 6*(5*n+6)*(2*n+5)*(7*n+6)*(499359*n^6+ 6777015*n^5+38079431*n^4+113390385*n^3+18872398*n^2+ 166469280*n+60800544)*a(n+2)+ 5*(5*n+14)*(5*n+13)*(5*n+12)*(7*n+12)*(5*n+11)*(5*n+6)*(7*n+13)*(7*n+6)*(n+3)*a(n+3) = 0. - Doron Zeilberger, Apr 02 2013
a(n) ~ sqrt(3) * 36^n / sqrt(35*Pi*n). - Vaclav Kotesovec, Dec 09 2021

A273975 Three-dimensional array written by antidiagonals in k,n: T(k,n,h) with k >= 1, n >= 0, 0 <= h <= n*(k-1) is the coefficient of x^h in the polynomial (1 + x + ... + x^(k-1))^n = ((x^k-1)/(x-1))^n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 2, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 3, 2, 1, 1, 3, 6, 7, 6, 3, 1, 1, 4, 6, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 4, 3, 2, 1, 1, 3, 6, 10, 12, 12, 10, 6, 3, 1, 1, 4, 10
Offset: 1

Views

Author

Andrey Zabolotskiy, Nov 10 2016

Keywords

Comments

Equivalently, T(k,n,h) is the number of ordered sets of n nonnegative integers < k with the sum equal to h.
From Juan Pablo Herrera P., Nov 21 2016: (Start)
T(k,n,h) is the number of possible ways of randomly selecting h cards from k-1 sets, each with n different playing cards. It is also the number of lattice paths from (0,0) to (n,h) using steps (1,0), (1,1), (1,2), ..., (1,k-1).
Shallow diagonal sums of each triangle with fixed k give the k-bonacci numbers. (End)
T(k,n,h) is the number of n-dimensional grid points of a k X k X ... X k grid, which are lying in the (n-1)-dimensional hyperplane which is at an L1 distance of h from one of the grid's corners, and normal to the corresponding main diagonal of the grid. - Eitan Y. Levine, Apr 23 2023

Examples

			For first few k and for first few n, the rows with h = 0..n*(k-1) are given:
k=1:  1;  1;  1;  1;  1; ...
k=2:  1;  1, 1;  1, 2, 1;  1, 3, 3, 1;  1, 4, 6, 4, 1; ...
k=3:  1;  1, 1, 1;  1, 2, 3, 2, 1;  1, 3, 6, 7, 6, 3, 1; ...
k=4:  1;  1, 1, 1, 1;  1, 2, 3, 4, 3, 2, 1; ...
For example, (1 + x + x^2)^3 = 1 + 3*x + 6*x^2 + 7*x^3 + 6*x^4 + 3*x^5 + x^6, hence T(3,3,2) = T(3,3,4) = 6.
From _Eitan Y. Levine_, Apr 23 2023: (Start)
Example for the repeated cumulative sum formula, for (k,n)=(3,3) (each line is the cumulative sum of the previous line, and the first line is the padded, alternating 3rd row from Pascal's triangle):
  1  0  0 -3  0  0  3  0  0 -1
  1  1  1 -2 -2 -2  1  1  1
  1  2  3  1 -1 -3 -2 -1
  1  3  6  7  6  3  1
which is T(3,3,h). (End)
		

Crossrefs

k-nomial arrays for fixed k=1..10: A000012, A007318, A027907, A008287, A035343, A063260, A063265, A171890, A213652, A213651.
Arrays for fixed n=0..6: A000012, A000012, A004737, A109439, A277949, A277950, A277951.
Central n-nomial coefficients for n=1..9, i.e., sequences with h=floor(n*(k-1)/2) and fixed n: A000012, A000984 (A001405), A002426, A005721 (A005190), A005191, A063419 (A018901), A025012, (A025013), A025014, A174061 (A025015), A201549, (A225779), A201550. Arrays: A201552, A077042, see also cfs. therein.
Triangle n=k-1: A181567. Triangle n=k: A163181.

Programs

  • Mathematica
    a = Table[CoefficientList[Sum[x^(h-1),{h,k}]^n,x],{k,10},{n,0,9}];
    Flatten@Table[a[[s-n,n+1]],{s,10},{n,0,s-1}]
    (* alternate program *)
    row[k_, n_] := Nest[Accumulate,Upsample[Table[((-1)^j)*Binomial[n,j],{j,0,n}],k],n][[;;n*(k-1)+1]] (* Eitan Y. Levine, Apr 23 2023 *)

Formula

T(k,n,h) = Sum_{i = 0..floor(h/k)} (-1)^i*binomial(n,i)*binomial(n+h-1-k*i,n-1). [Corrected by Eitan Y. Levine, Apr 23 2023]
From Eitan Y. Levine, Apr 23 2023: (Start)
(T(k,n,h))_{h=0..n*(k-1)} = f(f(...f(g(P))...)), where:
(x_i)_{i=0..m} denotes a tuple (in particular, the LHS contains the values for 0 <= h <= n*(k-1)),
f repeats n times,
f((x_i){i=0..m}) = (Sum{j=0..i} x_j)_{i=0..m} is the cumulative sum function,
g((x_i){i=0..m}) = (x(i/k) if k|i, otherwise 0)_{i=0..m*k} is adding k-1 zeros between adjacent elements,
and P=((-1)^i*binomial(n,i))_{i=0..n} is the n-th row of Pascal's triangle, with alternating signs. (End)
From Eitan Y. Levine, Jul 27 2023: (Start)
Recurrence relations, the first follows from the sequence's defining polynomial as mentioned in the Smarandache link:
T(k,n+1,h) = Sum_{i = 0..s-1} T(k,n,h-i)
T(k+1,n,h) = Sum_{i = 0..n} binomial(n,i)*T(k,n-i,h-i*k) (End)

A124805 Number of circular n-letter words over the alphabet {0,1,2,3} with adjacent letters differing by at most 2.

Original entry on oeis.org

1, 4, 14, 46, 162, 574, 2042, 7270, 25890, 92206, 328394, 1169590, 4165554, 14835838, 52838618, 188187526, 670239810, 2387094478, 8501763050, 30279478102, 107841960402, 384084837406, 1367938433018, 4871984973862
Offset: 0

Views

Author

R. H. Hardin, Dec 28 2006

Keywords

Comments

Empirical: a(base, n) = a(base-1, n) + A005191(n+1) for base >= 2*floor(n/2) + 1 where base is the number of letters in the alphabet.
Sequence appears to have generating function (1-x^2-4*x^3)/((1-x)*(1-3*x-2*x^2)). The degree of the numerator would drop by one if the initial term were changed from 1 to 3: (3-8*x+x^2)/((1-x)*(1-3*x-2*x^2)). - Creighton Dement, Aug 20 2007

Crossrefs

Programs

  • Magma
    I:=[1,4,14,46]; [n le 4 select I[n] else 4*Self(n-1) -Self(n-2) -2*Self(n-3): n in [1..40]]; // G. C. Greubel, Aug 03 2023
    
  • Mathematica
    LinearRecurrence[{4,-1,-2}, {1,4,14,46}, 40] (* G. C. Greubel, Aug 03 2023 *)
  • SageMath
    A206776=BinaryRecurrenceSequence(3,2,2,3)
    [1+A206776(n) -2*int(n==0) for n in range(41)] # G. C. Greubel, Aug 03 2023

Formula

a(n) = 1 + A206776(n) for n > 0. - Bruno Berselli, Jan 11 2013
From Colin Barker, Jun 02 2017: (Start)
G.f.: (1 - x^2 - 4*x^3) / ((1 - x)*(1 - 3*x - 2*x^2)).
a(n) = 1 + ((3-sqrt(17))/2)^n + ((3+sqrt(17))/2)^n for n>0.
a(n) = 4*a(n-1) - a(n-2) - 2*a(n-3) for n > 3. (End)

A124807 Number of base-6 circular n-digit numbers with adjacent digits differing by 2 or less.

Original entry on oeis.org

1, 6, 24, 84, 332, 1336, 5478, 22658, 94196, 392664, 1639274, 6849002, 28627874, 119688094, 500456806, 2092720174, 8751273556, 36596513060, 153042707976, 640011807436, 2676483843602, 11192882945426, 46807955443900
Offset: 0

Views

Author

R. H. Hardin, Dec 28 2006

Keywords

Comments

[Empirical] a(base,n) = a(base-1,n) + A005191(n+1) for base >= 2*floor(n/2) + 1.

Crossrefs

Programs

  • Magma
    I:=[1,6,24,84,332,1336,5478]; [n le 7 select I[n] else 6*Self(n-1) -6*Self(n-2) -8*Self(n-3) +5*Self(n-4) +2*Self(n-5) -Self(n-6): n in [1..41]]; // G. C. Greubel, Aug 04 2023
    
  • Mathematica
    LinearRecurrence[{6,-6,-8,5,2,-1}, {1,6,24,84,332,1336,5478}, 35] (* G. C. Greubel, Aug 04 2023 *)
  • SageMath
    @CachedFunction
    def a(n): # a = A124807
        if (n<7): return (1,6,24,84,332,1336,5478)[n]
        else: return 6*a(n-1) -6*a(n-2) -8*a(n-3) +5*a(n-4) +2*a(n-5) -a(n-6)
    [a(n) for n in range(41)] # G. C. Greubel, Aug 04 2023

Formula

From Colin Barker, Jun 04 2017: (Start)
G.f.: (1 - 6*x^2 - 16*x^3 + 15*x^4 + 8*x^5 - 5*x^6) / ((1 - 4*x - x^2 + x^3)*(1 - 2*x - x^2 + x^3)).
a(n) = 6*a(n-1) - 6*a(n-2) - 8*a(n-3) + 5*a(n-4) + 2*a(n-5) - a(n-6) for n > 6.
(End)
a(n) = -5*[n=0] + 3*A006054(n+2) - 4*A006054(n+1) - A006054(n) + 3*A364705(n) - 8*A364705(n-1) - A364705(n-2). - G. C. Greubel, Aug 04 2023

A104184 a(n) is the number of paths from (0,0) to (n,0) using steps of the form (1,2),(1,1),(1,0),(1,-1) or (1,-2) and staying above the x-axis. Also, a(n) is the number of possible combinations of balls on the lawn after n turns, using a Motzkin variation of the (4,2)-case of the tennis ball problem considered by D. Merlini, R. Sprugnoli and M. C. Verri.

Original entry on oeis.org

1, 1, 3, 9, 32, 120, 473, 1925, 8034, 34188, 147787, 647141, 2864508, 12796238, 57615322, 261197436, 1191268350, 5462080688, 25162978925, 116414836445, 540648963645, 2519574506595, 11779011525030, 55225888341334, 259612579655392, 1223396051745310
Offset: 0

Views

Author

Nicholas Biller (billern(AT)gmail.com), Mar 11 2005

Keywords

Comments

The (4,2)-case of the Motzkin Tennis Ball Problem is a variation of the Tennis Ball Problem that generates a(n). On each turn, i, four balls labeled i are placed in the bucket and then any two are removed and placed on the lawn. We consider all possible combinations of balls on the lawn after n turns.
The number of ways to choose n numbers, ranging from 0 to 4, so that their sum is 2n and so that when you take k numbers from the left, the sum of these numbers is <= 2k (e.g. the combination of {141} is impossible, for 1+4 > 2k). Thus a(1) = {2}; a(2) = {04}, {13} and {22}; a(3) = {024}, {033}, {042}, {114}, {123}, {132}, {204}, {213} and {222}. - Joost Vermeij (joost_vermeij(AT)hotmail.com), Jun 12 2005

Examples

			a(3) = 9, since the possible combinations of balls on the lawn after 3 turns is 111122, 111123, 111133, 111222, 111223, 111233, 112222, 112223, 112233, if on each turn there are 4 identically labeled balls received and 2 selected.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<5, [1, 1, 3, 9, 32][n+1],
          ((n+1)*(43*n^3-48*n^2-7*n+2)*a(n-1)
          -(124*n^4-370*n^3+255*n^2+15*n-14)*a(n-2)
          +5*(n-2)*(2*n^3-52*n^2+65*n-1)*a(n-3)
          +25*(n-2)*(n-3)*(8*n^2-8*n-1)*a(n-4)
          -125*n*(n-2)*(n-3)*(n-4)*a(n-5))/
           (2*(n-1)*(n+1)*(n+2)*(2*n+1)))
        end:
    seq(a(n), n=0..30);  # Alois P. Heinz, Oct 11 2013
  • Mathematica
    CoefficientList[Series[(1 + x + Sqrt[1 - 6*x + 5*x^2] - Sqrt[2]*Sqrt[1 + Sqrt[1 - 6*x + 5*x^2] + x*(-2 - 5*x + Sqrt[1 - 6*x + 5*x^2])])/(4*x^2), {x, 0, 20}], x] (* Vaclav Kotesovec, Sep 09 2014 *)
  • Maxima
    a(n):=((sum(binomial(n+1,l)*sum(binomial(i,2*l-1)*sum(binomial(j,n-j-i-1) *binomial(n-l+1,j),j,0,n-l+1),i,0,n-1),l,1,n+1))+sum(binomial(j,n-j) *binomial(n+1,j),j,0,n+1))/(n+1); /* Vladimir Kruchinin, Jun 26 2015 */
  • PARI
    {a(n)=local(A=1);A=exp(sum(m=1,n+1,polcoeff(((1-x^5)/(1-x) +O(x^(2*m+1)))^m, 2*m)*x^m/m)+x*O(x^n));polcoeff(A,n)} /* Paul D. Hanna */
    

Formula

G.f. (for offset 1): (1/(4*x))*(1+x+sqrt((1-6*x+5*x^2)) - sqrt(2)*sqrt(1+sqrt((1-6*x+5*x^2)) + x*(-2-5*x+sqrt((1-6*x+5*x^2))))). - N-E. Fahssi, Jan 10 2008
Let M be the infinite pentadiagonal matrix with all 1's in the 1st and 2nd subdiagonals, the main diagonal, and the 1st and 2nd superdiagonals, and with the rest 0's. V = vector [1,0,0,0,...]. The sequence starting with offset 1 = iterates of M*V, leftmost column. - Gary W. Adamson, Jun 06 2011
From Paul D. Hanna, Oct 19 2011: (Start)
Logarithmic derivative yields the central pentanomial coefficients (A005191).
G.f.: exp( Sum_{n>=1} A005191(n)*x^n/n ).
G.f.: (1/x)*Series_Reversion(x*(1-x^5)*(1-x^2)*(1-x)/(1-x^10)).
G.f. satisfies: A(x) = (1-x^10*A(x)^10)/((1-x^5*A(x)^5)*(1-x^2*A(x)^2)*(1-x*A(x))). (See formula from Michael Somos in A005191.) (End)
a(n) ~ (3-sqrt(5)) * 5^(n+1) / (4 * sqrt(Pi) * n^(3/2)). - Vaclav Kotesovec, Sep 09 2014
a(n) = ((Sum_{l=1..n+1} (C(n+1,l)*Sum_{i=0..n-1} (C(i,2*l-1) * Sum_{j=0..n-l+1} (C(j,n-j-i-1)*C(n-l+1,j))))) + Sum_{j=0..n+1} (C(j,n-j) * C(n+1,j)))/(n+1). - Vladimir Kruchinin, Jun 26 2015
-2*(n-1)*(2*n+1)*(n+2)*(n+1)*a(n) +(n+1)*(43*n^3-48*n^2-7*n+2)*a(n-1) +(-124*n^4+370*n^3-255*n^2-15*n+14)*a(n-2) +5*(n-2)*(2*n^3-52*n^2+65*n-1)*a(n-3) +25*(n-2)*(n-3)*(8*n^2-8*n-1)*a(n-4) -125*n*(n-2)*(n-3)*(n-4)*a(n-5)=0. - R. J. Mathar, Jul 23 2017
Showing 1-10 of 43 results. Next