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.

A344560 a(n) = hypergeom([-n/3, (1 - n)/3, (2 - n)/3], [1, 1], -27).

Original entry on oeis.org

1, 1, 1, 7, 25, 61, 211, 841, 2857, 9745, 36421, 134971, 488731, 1807807, 6788965, 25384087, 95114377, 359291737, 1361265889, 5162682775, 19642369405, 74960720065, 286563664135, 1097430871285, 4211301910795, 16187715501811, 62311953400711, 240203420513161
Offset: 0

Views

Author

Peter Luschny, Jun 01 2021

Keywords

Comments

Let T(n,k) be the number of words of length n with an alphabet of size M where the first k=M-1 letters of the alphabet appear with the same frequency f in each word. Then T(n,k) = Sum_{f=0..n/k} Product_{i=0..k-1} binomial(n-i*f,f) and a(n) = T(n,3), A002426(n)=T(n,2). Removing the words with cycles by the inclusion-exclusion principle by a Mobius Transform gives words of length n of that type without cycles and division through n the Lyndon words of that type, A349002. - R. J. Mathar, Nov 07 2021
Diagonal of the rational function 1 / (1 - x^3 - y^3 - z^3 - x*y*z). - Ilya Gutkovskiy, Apr 22 2025

Crossrefs

Cf. A344559.

Programs

  • Maple
    a := n -> hypergeom([-n/3, (1 - n)/3, (2 - n)/3], [1, 1], -27):
    seq(simplify(a(n)), n = 0..27);
    a := proc(n) option remember; if n < 4 then [1, 1, 1, 7][n+1] else
    ((28*n^2 - 84*n + 56)*a(n - 3) - 3*(n - 1)^2*a(n - 2) + (3*n^2 - 3*n + 1)*a(n - 1))/ n^2 fi end: seq(a(n), n = 0..27);
  • Mathematica
    Table[HypergeometricPFQ[{-n/3, (1 - n)/3, (2 - n)/3}, {1, 1}, -27], {n, 0, 27}] (* Amiram Eldar, Jun 22 2021 *)
  • PARI
    a(n)=sum(k=0, n\3, n!/(k!^3*(n-3*k)!)) \\ Andrew Howroyd, Jan 14 2023
    
  • Python
    from sympy import hyperexpand, Rational
    from sympy.functions import hyper
    def A344560(n): return hyperexpand(hyper((Rational(-n,3),Rational(1-n,3),Rational(2-n,3)),(1,1),-27)) # Chai Wah Wu, Jan 04 2024

Formula

D-finite with recurrence n^2*a(n) = (28*n^2 - 84*n + 56)*a(n-3) - 3*(n - 1)^2*a(n-2) + (3*n^2 - 3*n + 1)* a(n-1) for n >= 4.
From Haoran Chen, Jun 22 2021: (Start)
a(n) ~ 2 * 4^n/(sqrt(3) * n * Pi).
a(n) = [(x*y)^0] (1 + x + y + 1/(x * y))^n. (End)
a(n) = Sum_{k=0..floor(n/3)} n!/(k!^3*(n-3*k)!). - Andrew Howroyd, Jan 14 2023

A097861 Number of humps in all Motzkin paths of length n. (A hump is an upstep followed by 0 or more flatsteps followed by a downstep.)

Original entry on oeis.org

0, 0, 1, 3, 9, 25, 70, 196, 553, 1569, 4476, 12826, 36894, 106470, 308113, 893803, 2598313, 7567465, 22076404, 64498426, 188689684, 552675364, 1620567763, 4756614061, 13974168190, 41088418150, 120906613075, 356035078101, 1049120176953, 3093337815409
Offset: 0

Views

Author

Emeric Deutsch, Sep 01 2004

Keywords

Comments

If the independent variable x in the g.f. is subjected to the transformation x -> x/(1 + x + x^2), an inverse Motzkin transform, the 4-periodic sequence 0, 1, bar(2, 3, 2, 2) (offset 0) results, where bar(...) denotes the period. - R. J. Mathar, Nov 10 2008
Also, a(n) is the number of combinations of two disjoint subsets of equal size from a set of n items, where k, the size of the subset, goes from 1 to floor(n/2) inclusive. For each k, k items are chosen from n. Then k items are chosen from the remaining (n - k) items. Since each pair "kSubSet|kSubSet" is chosen twice, once as "A|B", once as "B|A", in order to remove repetitions, the number must be divided by 2. Since C(n, n + d) = 0 when d > 0, the upper limit can be safely increased from floor(n/2) to n. Thus a(n) = Sum_{k=1..n} C(n, k)*C(n-k, k)/2. - Viktar Karatchenia, Sep 09 2015

Examples

			a(3) = 3 because in all Motzkin paths of length 3 we have 3 humps, shown between parentheses: FFF, F(UD), (UD)F, (UFD) (here U = (1,1), F = (1,0), D = (1,-1)).
a(5) = (10 + 15) = 25 combinations of two equal size distinct subsets, i.e. given 5 items, there are 10 distinct pairs of size 1: "1|2, 1|3, 1|4, 1|5, and 2|3, 2|4, 2|5, and 3|4, 3|5, 4|5". Plus 15 distinct pairs of size 2: "12|34, 12|35, 12|45, and 13|24, 13|25, 13|45, and 14|23, 14|25, 14|35, and 15|23, 15|24, 15|34, and 23|45, 24|35, 25|34". - _Viktar Karatchenia_, Sep 09 2015
		

Crossrefs

Programs

  • Magma
    I := [0,0,1,3]; [n le 4 select I[n] else ((3*n^2-7*n+3)*Self(n-1)+(n-1)*(n-3)*Self(n-2)-3*(n-1)*(n-2)*Self(n-3))  div (n*(n-2)): n in [1..30]]; // Vincenzo Librandi, Sep 14 2015
    
  • Maple
    G := (1-z-sqrt(1-2*z-3*z^2))/2/(1-z)/sqrt(1-2*z-3*z^2):
    Gser := series(G, z=0, 33): seq(coeff(Gser, z^n), n = 0..32);
    # Alternative:
    a := n -> add(binomial(n,j)*binomial(n-j,j)/2, j=1..n):
    seq(a(n), n = 0..27); # Zerinvary Lajos, Sep 24 2006
    # Third program:
    Exp := (x, m) -> sum((x^k / k!)^m, k = 0..infinity):
    egf := Exp(2*x, 1)*(Exp(2*x, 2) - 1): ser := series(egf, x, 32):
    seq((1/2)*2^(-n)*n!*simplify(coeff(ser, x, n)), n = 0..29); # Peter Luschny, Jun 01 2021
  • Mathematica
    CoefficientList[Series[(1 - z - Sqrt[1 - 2 z - 3 z^2])/(2 (1 - z) Sqrt[1 - 2 z - 3 z^2]), {z, 0, 33}], z] (* Vincenzo Librandi, Sep 14 2015 *)
    a[n_] := (1/2)*(HypergeometricPFQ[{1/2 - n/2, -n/2}, {1}, 4] - 1);
    Table[a[n], {n, 0, 29}] (* Peter Luschny, Jun 01 2021 *)
  • Python
    from sympy import hyperexpand, S
    from sympy.functions import hyper
    def A097861(n): return hyperexpand(hyper(((1-n)*S.Half,-n*S.Half),(1,),4))-1>>1 # Chai Wah Wu, Jan 04 2024

Formula

G.f.: (1 - z - sqrt(1 - 2*z - 3*z^2))/(2*(1 - z)*sqrt(1 - 2*z - 3*z^2)).
From Vladeta Jovovic, Jul 24 2005: (Start)
a(n) = (A002426(n) - 1)/2.
E.g.f.: exp(x)*(BesselI(0, 2*x) - 1)/2. (End)
a(n) = Sum_{j=1..n} C(n, j)*C(n-j, j)/2. - Zerinvary Lajos, Sep 24 2006
n*(n - 2)*a(n) - (3*n^2 - 7*n + 3)*a(n-1) - (n - 1)*(n - 3)*a(n-2) + 3*(n - 1)*(n - 2)*a(n-3) = 0. - R. J. Mathar, Feb 21 2010
From Peter Luschny, Jun 01 2021: (Start)
a(n) = (1/2)*(hypergeom([1/2 - n/2, -n/2], [1], 4) - 1).
a(n) = (1/2)*2^(-n)*n!*[x^n] Exp(2*x, 1)*(Exp(2*x, 2) - 1), where Exp(x, m) = Sum_{k>=0} (x^k / k!)^m. Cf. A344559. (End)

Extensions

a(0) = 0 prepended by Peter Luschny, Jun 01 2021

A346906 Triangle read by rows: T(n,k) is the number of ways of choosing a k-dimensional cube from the vertices of an n-dimensional hypercube, where one of the vertices is the origin; 0 <= k <= n.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 7, 3, 1, 1, 15, 9, 4, 1, 1, 31, 25, 10, 5, 1, 1, 63, 70, 35, 15, 6, 1, 1, 127, 196, 140, 35, 21, 7, 1, 1, 255, 553, 476, 175, 56, 28, 8, 1, 1, 511, 1569, 1624, 1071, 126, 84, 36, 9, 1, 1, 1023, 4476, 6070, 4935, 1197, 210, 120, 45, 10, 1
Offset: 0

Views

Author

Peter Kagey, Aug 06 2021

Keywords

Examples

			Triangle begins:
n\k | 0     1     2     3     4     5    6    7   8   9
----+--------------------------------------------------
  0 | 1;
  1 | 1,    1;
  2 | 1,    3,    1;
  3 | 1,    7,    3,    1;
  4 | 1,   15,    9,    4,    1;
  5 | 1,   31,   25,   10,    5,    1;
  6 | 1,   63,   70,   35,   15,    6,   1;
  7 | 1,  127,  196,  140,   35,   21,   7,   1;
  8 | 1,  255,  553,  476,  175,   56,  28,   8,  1;
  9 | 1,  511, 1569, 1624, 1071,  126,  84,  36,  9,  1
One of the T(7,3) = 140 ways of choosing a 3-cube from the vertices of a 7-cube where one of the vertices is the origin is the cube with the following eight points:
(0,0,0,0,0,0,0);
(1,1,0,0,0,0,0);
(0,0,1,0,0,1,0);
(0,0,0,0,1,0,1);
(1,1,1,0,0,1,0);
(1,1,0,0,1,0,1);
(0,0,1,0,1,1,1); and
(1,1,1,0,1,1,1).
		

Crossrefs

Columns: A000012 (k=0), A000225 (k=1), A097861 (k=2), A344559 (k=3).
Cf. A346905.

Programs

  • Mathematica
    T[n_, 0] := 1
    T[n_, k_] := Sum[n!/(k!*(i!)^k*(n - i*k)!), {i, 1, n/k}]

Formula

T(n,k) = A346905(n,k)/2^(n-k).
Showing 1-3 of 3 results.