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

A212334 Number of words, either empty or beginning with the first letter of the 4-ary alphabet, where each letter of the alphabet occurs n times and letters of neighboring word positions are equal or neighbors in the alphabet.

Original entry on oeis.org

1, 1, 9, 163, 3593, 87501, 2266155, 61211095, 1704838665, 48605519665, 1411522695509, 41606511550803, 1241591466423467, 37435593955828069, 1138713916992923679, 34901292375152457663, 1076813644170756916745, 33416749492077957930105, 1042376218505671236116985
Offset: 0

Views

Author

Alois P. Heinz, Aug 07 2012

Keywords

Comments

Also the number of (4*n-1)-step walks on 4-dimensional cubic lattice from (1,0,0,0) to (n,n,n,n) with positive unit steps in all dimensions such that the absolute difference of the dimension indices used in consecutive steps is <= 1.
It appears that for primes p >= 5, a(p) == 1 (mod p^5). Cf. A352655. - Peter Bala, Dec 12 2021
Conjecture: for r >= 2, and all primes p >= 5, a(p^r) == a(p^(r-1)) (mod p^(3*r+3)). - Peter Bala, Oct 13 2022

Crossrefs

Column k = 4 of A208673.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<3, [1, 1, 9][n+1],
          ((26682*n^4 -102687*n^3 +149385*n^2 -109413*n +31101) *a(n-1)
          +(-161058*n^4 +1392915*n^3 -4418826*n^2 +6030348*n -2931516) *a(n-2)
          +(4718*n^4 -47957*n^3 +176841*n^2 -275751*n +148365) *a(n-3)) /
          (n^3 *(646*n -1057)))
        end:
    seq(a(n), n=0..30);
  • Mathematica
    a[n_] := a[n] = If[n < 3, {1, 1, 9}[[n + 1]], ((26682 n^4 - 102687 n^3 + 149385 n^2 - 109413 n + 31101) a[n-1] + (-161058 n^4 + 1392915 n^3 - 4418826 n^2 + 6030348 n - 2931516)a[n-2] + (4718 n^4 - 47957 n^3 + 176841 n^2 - 275751 n + 148365)a[n-3])/(n^3 (646 n - 1057))];
    a /@ Range[0, 30] (* Jean-François Alcover, May 14 2020, after Maple *)

Formula

a(n) ~ (1 + sqrt(2))^(4*n-1) / (2^(7/4) * (Pi*n)^(3/2)). - Vaclav Kotesovec, Aug 13 2013, simplified Apr 06 2022
From Peter Bala, Apr 17 2022: (Start)
a(n) = (1/12)*(A005259(n) + 7*A005259(n-1)) for n >= 1.
The supercongruences a(n*p^k) == a(n*p^(k-1)) (mod p^(3*k)) hold for all primes p >= 5 and positive integers n and k.
a(n) = (1/3)*Sum_{k = 0..n} binomial(n,k)^2*binomial(n + k,k)^2*(2*n^2 - 3*k*n + 2*k^2)/(n + k)^2.
(24*n^3 - 102*n^2 + 148*n - 73)*n^3*a(n) = 4*(204*n^6 - 1173*n^5 + 2668*n^4 - 3065*n^3 + 1905*n^2 - 634*n + 86)*a(n-1) - (24*n^3 - 30*n^2 + 16*n-3)*(n - 2)^3*a(n-2) with a(0) = a(1) = 1. (End)
a(n) = Sum_{k=0..n-1} binomial(n,k)*binomial(n-1,k)*binomial(n+k-1,k)^2 for n>=1. - Peter Bala, Mar 22 2023

A208675 Number of words, either empty or beginning with the first letter of the ternary alphabet, where each letter of the alphabet occurs n times and letters of neighboring word positions are equal or neighbors in the alphabet.

Original entry on oeis.org

1, 1, 5, 37, 309, 2751, 25493, 242845, 2360501, 23301307, 232834755, 2349638259, 23905438725, 244889453043, 2523373849701, 26132595017037, 271826326839477, 2838429951771795, 29740725671232119, 312573076392760183, 3294144659048391059, 34802392680979707121
Offset: 0

Views

Author

Alois P. Heinz, Feb 29 2012

Keywords

Comments

Also the number of (3*n-1)-step walks on 3-dimensional cubic lattice from (1,0,0) to (n,n,n) with positive unit steps in all dimensions such that the absolute difference of the dimension indices used in consecutive steps is <= 1.

Examples

			a(2) = 5 = |{aabbcc, aabcbc, aabccb, ababcc, abccba}|.
a(3) = 37 = |{aaabbbccc, aaabbcbcc, aaabbccbc, aaabbcccb, aaabcbbcc, aaabcbcbc, aaabcbccb, aaabccbbc, aaabccbcb, aaabcccbb, aababbccc, aababcbcc, aababccbc, aababcccb, aabbabccc, aabbcccba, aabcbabcc, aabcbccba, aabccbabc, aabccbcba, aabcccbab, aabcccbba, abaabbccc, abaabcbcc, abaabccbc, abaabcccb, abababccc, ababcccba, abbaabccc, abbcccbaa, abcbaabcc, abcbccbaa, abccbaabc, abccbcbaa, abcccbaab, abcccbaba, abcccbbaa}|.
		

Crossrefs

Programs

  • Magma
    A208675:= func< n | (&+[Binomial(n,j)*Binomial(n-1,j)*Binomial(n+j-1,j): j in [0..2*n]]) >;
    [A208675(n): n in [0..30]]; // G. C. Greubel, Oct 05 2023
    
  • Maple
    a:= n-> add(binomial(n-1, k)^2 *binomial(2*n-1-k, n-k), k=0..n):
    seq(a(n), n=0..30);  # Alois P. Heinz, Jun 26 2012
  • Mathematica
    a[n_]:= HypergeometricPFQ[{1-n,-n,n}, {1,1}, 1] (* Michael Somos, Jun 03 2012 *)
  • SageMath
    def A208675(n): return sum(binomial(n,j)*binomial(n-1,j)*binomial(n+j-1,j) for j in range(n+1))
    [A208675(n) for n in range(31)] # G. C. Greubel, Oct 05 2023

Formula

From Michael Somos, Jun 03 2012: (Start)
a(n) = A108625(n-1, n).
a(n) = Hypergeometric3F2([1-n, -n, n], [1, 1], 1).
(n+1)^2 * (1 -4*n +5*n^2) * a(n+1) = (5 -5*n -26*n^2 +11*n^3 +55*n^4) * a(n) + (n-1)^2 * (2 +6*n +5*n^2) * a(n-1). (End)
a(n) ~ sqrt((5-sqrt(5))/10)/(2*Pi*n) * ((1+sqrt(5))/2)^(5*n). - Vaclav Kotesovec, Dec 06 2012. Equivalently, a(n) ~ phi^(5*n - 1/2) / (2 * 5^(1/4) * Pi * n), where phi = A001622 is the golden ratio. - Vaclav Kotesovec, Dec 07 2021
exp( Sum_{n >= 1} a(n)*x^n/n ) = 1 + x + 3*x^2 + 15*x^3 + 94*x^4 + 668*x^5 + 5144*x^6 + 41884*x^7 + 355307*x^8 + ... appears to have integer coefficients. Cf. A108628. - Peter Bala, Jan 12 2016
From Peter Bala, Apr 05 2022: (Start)
a(n) = Sum_{k = 0..n} binomial(n,k)*binomial(n-1,k)*binomial(n+k-1,k).
Using binomial(-n,k) = (-1)^k*binomial(n+k-1,k) for nonnegative k, we have:
a(-n) = Sum_{k = 0..n} binomial(-n,k)*binomial(-n-1,k)*binomial(-n+k-1,k).
a(-n) = Sum_{k = 0..n} (-1)^k* binomial(n+k-1,k)*binomial(n+k,k)*binomial(n,k)
a(-n) = (-1)^n*A108628(n-1), for n >= 1.
a(n) = Sum_{k = 1..n} binomial(n,k)*binomial(n-1,k-1)*binomial(n+k-1,k-1) for n >= 1.
Equivalently, a(n) = [(x^n)*(y*z)^(n-1)] (x + y + z)^n*(x + y)^(n-1)*(y + z)^(n-1) for n >= 1.
a(n) = Sum_{k = 0..n-1} (-1)^k*binomial(n-1,k)*binomial(2*n-k-1,n-k)^2.
a(n) = (1/5)*(A005258(n) + 2*A005258(n-1)) for n >= 1.
a(n) = [x^n] 1/(1 - x)*P(n-1,(1 + x)/(1 - x)) for n >= 1, where P(n,x) denotes the n-th Legendre polynomial. Compare with A005258(n) = [x^n] 1/(1 - x)*P(n,(1 + x)/(1 - x)).
a(n) = B(n,n-1,n-1) in the notation of Straub, equation 24. Hence
a(n) = [(x^n)*(y*z)^(n-1)] 1/(1 - x - y - z + x*z + y*z - x*y*z) for n >= 1.
The supercongruences a(n*p^k) == a(n*p^(k-1)) (mod p^(3*k)) hold for all primes p >= 5 and all positive integers n and k.
Conjectures:
1) a(n) = [(x*y)^n*z^(n-1)] 1/(1 - x - y - z + x*y + x*y*z) for n >= 1.
2) a(n) = - [(x*z)^(n-1)*(y^n)] 1/(1 + y + z + x*y + y*z + x*z + x*y*z) for n >= 1.
3) a(n) = [x^(n-1)*(y*z)^n] 1/(1 - x - x*y - y*z - x*z - x*y*z) for n >= 1. (End)
From Peter Bala, Mar 17 2023: (Start)
For n >= 1:
a(n) = Sum_{k = 0..n} ((n-k)/(n+k))*binomial(n,k)^2*binomial(n+k,k).
a(n) = Sum_{k = 0..n} (-1)^(n+k-1) * ((n-k)/(n+k)) * binomial(n,k) * binomial(n+k,k)^2. (End)

A208879 Number of words A(n,k), either empty or beginning with the first letter of the cyclic k-ary alphabet, where each letter of the alphabet occurs n times and letters of neighboring word positions are equal or neighbors in the alphabet; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 2, 30, 10, 1, 1, 1, 2, 62, 560, 35, 1, 1, 1, 2, 114, 2830, 11550, 126, 1, 1, 1, 2, 202, 12622, 151686, 252252, 462, 1, 1, 1, 2, 346, 53768, 1754954, 8893482, 5717712, 1716, 1, 1
Offset: 0

Views

Author

Alois P. Heinz, Mar 02 2012

Keywords

Comments

The first and the last letters are considered neighbors in a cyclic alphabet. The words are not considered cyclic here.
A(n,k) is also the number of (n*k-1)-step walks on k-dimensional cubic lattice from (1,0,...,0) to (n,n,...,n) with positive unit steps in all dimensions such that the indices of dimensions used in consecutive steps differ by less than 2 or are in the set {1,k}.

Examples

			A(0,0) = A(n,0) = A(0,k) = 1: the empty word.
A(1,2) = 1 = |{ab}|.
A(1,3) = 2 = |{abc, acb}|.
A(1,4) = 2 = |{abcd, adcb}|.
A(2,2) = 3 = |{aabb, abab, abba}|.
A(2,4) = 62 = |{aabbccdd, aabbcdcd, aabbcddc, aabcbcdd, aabcddcb, aadcbbcd, aadcdcbb, aaddcbbc, aaddcbcb, aaddccbb, ababccdd, ababcdcd, ababcddc, abadcbcd, abadcdcb, abaddcbc, abaddccb, abbadccd, abbadcdc, abbaddcc, abbccdad, abbccdda, abbcdadc, abbcdcda, abcbadcd, abcbaddc, abcbcdad, abcbcdda, abccbadd, abccddab, abcdabcd, abcdadcb, abcdcbad, abcdcdab, abcddabc, abcddcba, adabbccd, adabbcdc, adabcbcd, adabcdcb, adadcbbc, adadcbcb, adadccbb, adcbabcd, adcbadcb, adcbbadc, adcbbcda, adcbcbad, adcbcdab, adccbbad, adccdabb, adcdabbc, adcdabcb, adcdcbab, adcdcbba, addabbcc, addabcbc, addabccb, addcbabc, addcbcba, addccbab, addccbba}|.
Square array A(n,k) begins:
  1,  1,   1,       1,         1,           1,             1, ...
  1,  1,   1,       2,         2,           2,             2, ...
  1,  1,   3,      30,        62,         114,           202, ...
  1,  1,  10,     560,      2830,       12622,         53768, ...
  1,  1,  35,   11550,    151686,     1754954,      19341130, ...
  1,  1, 126,  252252,   8893482,   276049002,    8151741752, ...
  1,  1, 462, 5717712, 552309938, 46957069166, 3795394507240, ...
		

Crossrefs

Columns k=0+1, 2-6 give: A000012, A088218, A208881, A209183, A209184, A209185.
Rows n=0, 2 give: A000012, A208880.
Cf. A208673 (noncyclic alphabet).

Programs

  • Maple
    b:= proc() option remember; local n; n:= nargs;
         `if`(n<2 or {0}={args}, 1,
         `if`(n=2, `if`(args[1]>0, b(args[1]-1, args[2]), 0)+
                   `if`(args[2]>0, b(args[2]-1, args[1]), 0),
         `if`(args[1]>0, b(args[1]-1, seq(args[i], i=2..n)), 0)+
         `if`(args[2]>0, b(args[2]-1, seq(args[i], i=3..n), args[1]), 0)+
         `if`(args[n]>0, b(args[n]-1, seq(args[i], i=1..n-1)), 0)))
        end:
    A:= (n, k)-> `if`(n=0 or k=0, 1, b(n-1, n$(k-1))):
    seq(seq(A(n, d-n), n=0..d), d=0..9);
  • Mathematica
    b[args__] := b[args] = With[{n = Length[{args}]}, If[n<2 || {0} == Union[ {args}], 1, If[n==2, If[{args}[[1]]>0, b[{args}[[1]]-1, {args}[[2]] ], 0] + If[{args}[[2]]>0, b[{args}[[2]]-1, {args}[[1]] ], 0], If[{args}[[1]]>0, b[{args}[[1]]-1, Sequence @@ {args}[[2;;n]] ], 0] + If[{args}[[2]]>0, b[{args}[[2]]-1, Sequence @@ {args}[[3;;n]], {args}[[1]] ], 0]+ If[{args}[[n]]>0, b[{args}[[n]]-1, Sequence @@ Most[{args}]] ],0]] /. Null -> 0];
    a[n_,k_]:= If[n==0 || k==0, 1, b[n-1, Sequence @@ Array[n&, k-1]]];
    Table[Table[a[n, d-n], {n,0,d}], {d,0,9}] // Flatten (* Jean-François Alcover, Dec 13 2013, translated from Maple *)

A208674 Number of words, either empty or beginning with the first letter of the n-ary alphabet, where each letter of the alphabet occurs 3 times and letters of neighboring word positions are equal or neighbors in the alphabet.

Original entry on oeis.org

1, 1, 10, 37, 163, 640, 2503, 9559, 36154, 135541, 505279, 1875592, 6941035, 25629211, 94478338, 347857921, 1279622611, 4704064120, 17284247263, 63484653151, 233114307274, 855817783741, 3141437229271, 11529935743528, 42314502514051, 155283277278547
Offset: 0

Views

Author

Alois P. Heinz, Feb 29 2012

Keywords

Comments

Also the number of (3*n-1)-step walks on n-dimensional cubic lattice from (1,0,...,0) to (3,3,...,3) with positive unit steps in all dimensions such that the absolute difference of the dimension indices used in consecutive steps is <= 1.

Examples

			a(2) = 10 = |{aaabbb, aababb, aabbab, aabbba, abaabb, ababab, ababba, abbaab, abbaba, abbbaa}| with binary alphabet {a,b}.
a(3) = 37 = |{aaabbbccc, aaabbcbcc, aaabbccbc, aaabbcccb, aaabcbbcc, aaabcbcbc, aaabcbccb, aaabccbbc, aaabccbcb, aaabcccbb, aababbccc, aababcbcc, aababccbc, aababcccb, aabbabccc, aabbcccba, aabcbabcc, aabcbccba, aabccbabc, aabccbcba, aabcccbab, aabcccbba, abaabbccc, abaabcbcc, abaabccbc, abaabcccb, abababccc, ababcccba, abbaabccc, abbcccbaa, abcbaabcc, abcbccbaa, abccbaabc, abccbcbaa, abcccbaab, abcccbaba, abcccbbaa}| with ternary alphabet {a,b,c}.
		

Crossrefs

Row n=3 of A208673.

Programs

  • Maple
    a:= n-> (Matrix(5, (i, j)-> `if`(i=j-1, 1, `if`(i=5, [4, -2,
            -14, -1, 5][j], 0)))^n. <<1, 1, 10, 37, 163>>)[1, 1]:
    seq(a(n), n=0..30);

Formula

G.f.: -(4*x^4+2*x^3+6*x^2-4*x+1) / (4*x^5-2*x^4-14*x^3-x^2+5*x-1).

A351759 Number of words either empty or beginning with the first letter of the n-ary alphabet, where each letter of the alphabet occurs n times and letters of neighboring word positions are equal or neighbors in the alphabet.

Original entry on oeis.org

1, 1, 3, 37, 3593, 2336376, 12085125703, 492300320300251, 163856834420168837331, 450436951076447377275760495, 10360995769563446558192576106611177, 2010994252878923176109086647579398800496256, 3317129856969862808949985510559979253492213624483355
Offset: 0

Views

Author

Alois P. Heinz, Feb 18 2022

Keywords

Comments

Also the number of (n^2-1)-step walks on n-dimensional cubic lattice from (1,0,...,0) to (n,n,...,n) with positive unit steps in all dimensions such that the absolute difference of the dimension indices used in consecutive steps is <= 1.

Examples

			a(2) = 3:
  +----+   +----+   +----+
  |aabb|   |abab|   |abba|
  +----+   +----+   +----+
  |1222|   |1122|   |1112|
  |0012|   |0112|   |0122|
  +----+   +----+   +----+
  |xx  |   |x x |   |x  x|
  |  xx|   | x x|   | xx |
  +----+   +----+   +----+
a(3) = 37: aaabbbccc, aaabbcbcc, aaabbccbc, aaabbcccb, aaabcbbcc, aaabcbcbc, aaabcbccb, aaabccbbc, aaabccbcb, aaabcccbb, aababbccc, aababcbcc, aababccbc, aababcccb, aabbabccc, aabbcccba, aabcbabcc, aabcbccba, aabccbabc, aabccbcba, aabcccbab, aabcccbba, abaabbccc, abaabcbcc, abaabccbc, abaabcccb, abababccc, ababcccba, abbaabccc, abbcccbaa, abcbaabcc, abcbccbaa, abccbaabc, abccbcbaa, abcccbaab, abcccbaba, abcccbbaa.
		

Crossrefs

Main diagonal of A208673.

Programs

  • Maple
    b:= proc(l, t) option remember; (n-> `if`(l=[0$n], 1,
          add(`if`(l[i]=0, 0, b(subsop(i=l[i]-1, l), i)),
               i=max(1, t-1)..min(n, t+1))))(nops(l))
        end:
    a:= n-> b([n$n], 0):
    seq(a(n), n=0..6);
  • Mathematica
    b[l_, t_] := b[l, t] = Function [n, If[l == Array[0&, n], 1,
         Sum[If[l[[i]] == 0, 0, b[ReplacePart[l, i -> l[[i]] - 1], i]],
         {i, Max[1, t - 1], Min[n, t + 1]}]]][Length[l]];
    a[n_] := b[Array[n&, n], 0];
    Table[Print[n, " ", a[n]]; a[n], {n, 0, 7}] (* Jean-François Alcover, May 16 2022, after Alois P. Heinz *)

Formula

a(n) = A208673(n,n).
Showing 1-5 of 5 results.