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.

Previous Showing 31-40 of 590 results. Next

A275209 Expansion of (A(x)^2+A(x^2))/2 where A(x) = A001006(x)-1.

Original entry on oeis.org

0, 0, 1, 2, 7, 17, 49, 129, 358, 970, 2679, 7364, 20414, 56634, 157877, 441084, 1236496, 3474672, 9790403, 27648486, 78256907, 221951037, 630723367, 1795576937, 5120487946, 14625574662, 41837955145, 119851980508, 343798121799, 987445317761, 2839518519233
Offset: 0

Views

Author

R. J. Mathar, Jul 19 2016

Keywords

Comments

Analog of A274934 with Motzkin numbers replacing connected graph counts.

Crossrefs

Cf. A275210.

Programs

  • Maple
    b:= proc(n) option remember; `if`(n<2, 1,
          ((3*(n-1))*b(n-2)+(1+2*n)*b(n-1))/(n+2))
        end:
    a:= proc(n) option remember; add(b(j)*b(n-j), j=1..n/2)-
          `if`(n::odd, 0, (t->t*(t-1)/2)(b(n/2)))
        end:
    seq(a(n), n=0..40);  # Alois P. Heinz, Jul 19 2016
  • Mathematica
    b[n_] := b[n] = If[n<2, 1, ((3*(n-1))*b[n-2] + (1+2*n)*b[n-1])/(n+2)];
    a[n_] := a[n] = Sum[b[j]*b[n-j], {j, 1, n/2}] - If[OddQ[n], 0, Function[t, t*(t - 1)/2][b[n/2]]];
    Table[a[n], {n, 0, 40}] (* Jean-François Alcover, May 16 2017, after Alois P. Heinz *)

Formula

a(2n+1) = A275210(2n+1).

A275210 Expansion of (A(x)^2-A(x^2))/2 where A(x) = A001006(x)-1.

Original entry on oeis.org

0, 0, 0, 2, 5, 17, 45, 129, 349, 970, 2658, 7364, 20363, 56634, 157750, 441084, 1236173, 3474672, 9789568, 27648486, 78254719, 221951037, 630717569, 1795576937, 5120472435, 14625574662, 41837913310, 119851980508, 343798008165, 987445317761, 2839518208661
Offset: 0

Views

Author

R. J. Mathar, Jul 19 2016

Keywords

Comments

Analog of A216785 with Motzkin numbers replacing connected graph counts.

Crossrefs

Cf. A275209.

Programs

  • Maple
    b:= proc(n) option remember; `if`(n<2, 1,
          ((3*(n-1))*b(n-2)+(1+2*n)*b(n-1))/(n+2))
        end:
    a:= proc(n) option remember; add(b(j)*b(n-j), j=1..n/2)-
          `if`(n=0 or n::odd, 0, (t->t*(t+1)/2)(b(n/2)))
        end:
    seq(a(n), n=0..40);  # Alois P. Heinz, Jul 19 2016
  • Mathematica
    b[n_] := b[n] = If[n<2, 1, ((3*(n-1))*b[n-2] + (1+2*n)*b[n-1])/(n+2)];
    a[n_] := a[n] = Sum[b[j]*b[n - j], {j, 1, n/2}] - If[n == 0 || OddQ[n], 0, Function[t, t*(t + 1)/2][b[n/2]]];
    Table[a[n], {n, 0, 40}] (* Jean-François Alcover, May 16 2017, after Alois P. Heinz *)

Formula

a(2n+1) = A275209(2n+1).

A295132 a(n) = (2/n)*Sum_{k=1..n} (2k+1)*M(k)^2 where M(k) is the Motzkin number A001006(k).

Original entry on oeis.org

6, 23, 90, 432, 2286, 13176, 80418, 513764, 3400518, 23167311, 161640554, 1150633512, 8332048638, 61232315553, 455830692210, 3432015694314, 26101221114582, 200295455169015, 1549473966622602, 12074304397434552, 94713783502786686, 747454269790900728
Offset: 1

Views

Author

Zhi-Wei Sun, Nov 15 2017

Keywords

Comments

Sun (2014) conjectures that for any prime p > 3 we have Sum_{k = 0..p-1} M(k)^2 == (2 - 6*p)(p/3) (mod p^2) and Sum_{k = 0..p - 1} k*M(k)^2 == (9*p - 1)(p/3) (mod p^2), where (p/3) is the Legendre symbol.
Sun (2018) proves that a(n) is always an integer.

Examples

			a(2) = 23 since (2/2)*Sum_{k=1..2} (2k + 1)*M(k)^2 = (2*1 + 1)*M(1)^2 + (2*2 + 1)*M(2)^2 = 3*1^2 + 5*2^2 = 23.
		

Crossrefs

Programs

  • Maple
    h := k -> (4*k+2)*hypergeom([(1-k)/2,-k/2],[2],4)^2:
    a := proc(n) add(simplify(h(k)),k=1..n): if % mod n = 0 then %/n else -1 fi end:
    seq(a(n), n=1..25); # Peter Luschny, Nov 16 2017
  • Mathematica
    M[n_] := M[n] = Sum[Binomial[n, 2k] Binomial[2k, k]/(k + 1), {k, 0, n/2}];
    a[n_] := a[n] = 2/n * Sum[(2k + 1) M[k]^2, {k, 1, n}];
    Table[a[n], {n, 1, 25}]

Formula

a(n) = 2*A005043(n+1)*((6+6/n)*A005043(n) + (2+1/n)*A005043(n+1)). - Mark van Hoeij, Nov 10 2022

A354293 a(n) is the least integer m such that A001006(m) is divisible by prime(n)^2 or -1 if no such m exists.

Original entry on oeis.org

3, 4, -1, 23, 21, -1, 188, 65, 1010, 2231, -1, -1, 1326, 389, 1092, 13196, 1450, -1, 40466, 85553, 665, -1, 5139193, 333, -1, 408241, -1, 3072, 6702, 1393, 5832, 935, 1071, 77421, 292187, 775383, 493135, 4185, 1784560, 10632, 7935, 743003, 13418, 64499, 1746798, 12176, 152551
Offset: 1

Views

Author

Michel Marcus, May 23 2022

Keywords

Crossrefs

Motzkin numbers A001006 read mod 2,3,4,5,6,7,8,11: A039963, A039964, A299919, A258712, A299920, A258711, A299918, A258710.

Programs

  • PARI
    catalan(n) = binomial(2*n, n)/(n+1);
    M(n) = sum(k=0, n, (-1)^(n-k)*binomial(n, k)*catalan(k+1));
    a(n) = {my(p=prime(n)); if (p>200, error); if (vecsearch([5, 13, 31, 37, 61, 79, 97, 103], p), return (-1)); my(k=1); while (M(k) % p^2, k++); k;};

Extensions

a(16)-a(38) from Daniel Suteu, May 23 2022
a(39)-a(47) from Chai Wah Wu, May 23 2022

A377659 a(n) = Motzkin(n) - 2^(n - 1 + 0^n) = A001006(n) - A011782(n).

Original entry on oeis.org

0, 0, 0, 0, 1, 5, 19, 63, 195, 579, 1676, 4774, 13463, 37739, 105442, 294188, 820699, 2291243, 6405310, 17937140, 50327731, 141498983, 398666071, 1125566111, 3184339189, 9026625285, 25636264044, 72940663938, 207889060481, 593474349373, 1696848600299, 4858687934567
Offset: 0

Views

Author

Peter Luschny, Nov 28 2024

Keywords

Comments

These are the Motzkin words of length n - 1 over the alphabet 0, 1, 2,... that contain at least one digit greater than 1. See the Sage program below.
An analogous construction with the Catalan numbers can be found in A125107.

Examples

			  N:       0, 1, 2, 3, 4,  5,  6,   7,   8,   9, ...
  A001006: 1, 1, 2, 4, 9, 21, 51, 127, 323, 835, ...
  A011782: 1, 1, 2, 4, 8, 16, 32,  64, 128, 256, ...
  a:       0, 0, 0, 0, 1,  5, 19,  63, 195, 579, ...
.
For n = 5 the 5 Motzkin words of length 4 that have at least one term > 1 are:
  1221, 1211, 1210, 1121, 0121.
For n = 6 the 19 Motzkin words of length 5 that have at least one term > 1 are:
  12321, 12221, 12211, 12210, 12121, 12111, 12110, 12101, 12100, 11221, 11211, 11210, 11121, 10121, 01221, 01211, 01210, 01121, 00121.
		

Crossrefs

Programs

  • Maple
    gf := (1 - x - (1-2*x-3*x^2)^(1/2)) / (2*x^2) - (1 - x) / (1 - 2*x):
    ser := series(gf, x, 35): seq(coeff(ser, x, n), n = 0..30);
    # Alternative:
    a := n -> hypergeom([-n/2 + 1/2, -n/2], [2], 4) - 2^(n - 1 + 0^n);
    seq(simplify(a(n)), n = 0..29);
  • Mathematica
    A377659[n_] := If[n < 4, 0, HypergeometricPFQ[{-n/2, -n/2 + 1/2}, {2}, 4] - 2^(n - 1)];
    Array[A377659, 50, 0] (* Paolo Xausa, Dec 04 2024 *)
  • Python
    from itertools import islice
    show = lambda f, n: print(list(islice(f(), n)))
    def aGen():
        a, b, n, z = 1, 2, 2, 1
        yield 0
        while True:
            yield b//n - z
            n += 1; z *= 2
            a, b = b, (3*(n-1)*n*a + (2*n-1)*n*b)//((n+1)*(n-1))
    show(aGen, 31)
    
  • SageMath
    # Generates Motzkin words (for illustration only).
    def motzkin_words(n):
         return IntegerListsLex(length=n+1, min_slope=-1, max_slope=1,
                    ceiling=[0]+[+oo for i in range(n-1)]+[0])
    def MWList(n, show=True):
        c = 0
        for w in motzkin_words(n):
            if any(p > 1 for p in w):
                c += 1
                if show: print(''.join(map(str, w[1:-1])))
        return c
    for n in range(8): print(f"[{n}] -> {MWList(n)}")

Formula

a(n) = [x^n] (1 - x - (1 - 2*x - 3*x^2)^(1/2)) / (2*x^2) - (1 - x) / (1 - 2*x).
a(n) = hypergeom([-n/2, -n/2 + 1/2], [2], 4) - 2^(n - 1 + 0^n).

A080894 Expansion of the exponential series exp( x M(x) ) = exp( (1-sqrt(1-2x-3x^2))/(2x) ), where M(x) is the ordinary generating series of the Motzkin numbers A001006.

Original entry on oeis.org

1, 1, 3, 19, 169, 2001, 29371, 516643, 10590609, 248113729, 6541248691, 191719042131, 6185020391353, 217824649952209, 8316522297035499, 342188317852814371, 15095509523107176481, 710794856254145560833
Offset: 0

Views

Author

Emanuele Munarini, Mar 31 2003

Keywords

Crossrefs

Cf. A001006.

Programs

  • Mathematica
    #/Sqrt[E]&/@With[{nn=20},CoefficientList[Series[Exp[(1-Sqrt[1-2x-3x^2])/ (2x)],{x,0,nn}],x]Range[0,nn]!] (* Harvey P. Dale, Oct 26 2011 *)

Formula

E.g.f.: exp((1 - x - sqrt(1 - 2*x - 3*x^2))/(2x)).
a(n) = (n-1)!*Sum_{k=1..n} (1/(k-1)!)*Sum_{j=ceiling((n+k)/2)..n} binomial(n,j)*binomial(j,2*j-n-k). - Vladimir Kruchinin, Aug 11 2010
a(n) ~ 3^(n+1/2)*n^(n-1)/(sqrt(2)*exp(n-1)). - Vaclav Kotesovec, Oct 05 2013
Conjecture D-finite with recurrence: +(-2*n+3)*a(n) +(-2*n^3+9*n^2-9*n+1)*a(n-1) +(n-1)*(n-2)*(4*n^2-2*n-3)*a(n-2) +3*(n-1)*(n-3)*(2*n-1)*(n-2)^2*a(n-3)=0. - R. J. Mathar, Jan 24 2020

A086400 (1/p)*(M(p)-1) where p runs through the odd primes and M(p) = A001006(p) is the p-th Motzkin number.

Original entry on oeis.org

1, 4, 18, 527, 3218, 138634, 957857, 49120018, 20473889132, 156766505690, 74324776203270, 4686290685410776, 37541445026997947, 2445882966702428971, 1327937505693018342712, 743757817682170309535791, 6166664829842021655267818, 3568011384191503508502528953, 250506784439047192764704514076
Offset: 1

Views

Author

Benoit Cloitre, Sep 06 2003

Keywords

Crossrefs

Cf. A001006.

Programs

  • Mathematica
    motz[0] = motz[1] = 1; motz[n_] := motz[n] = ((2*n + 1)*motz[n-1] + 3*(n-1)*motz[n-2])/(n+2); Table[(motz[p]-1)/p, {p, Prime[Range[2, 20]]}] (* Amiram Eldar, Apr 20 2025 *)

Extensions

Data corrected by Amiram Eldar, Apr 20 2025

A086401 a(n) = M(n) (mod n) where M(n) = A001006(n) is the n-th Motzkin number.

Original entry on oeis.org

0, 0, 1, 1, 1, 3, 1, 3, 7, 8, 1, 7, 1, 10, 12, 11, 1, 6, 1, 19, 0, 3, 1, 21, 1, 16, 7, 5, 1, 1, 1, 19, 18, 20, 23, 7, 1, 3, 7, 17, 1, 36, 1, 41, 9, 26, 1, 21, 1, 28, 24, 45, 1, 33, 18, 43, 45, 32, 1, 39, 1, 34, 24, 51, 51, 42, 1, 19, 30, 7, 1, 9, 1, 40, 57, 57, 19, 24, 1, 17, 61, 44, 1, 37, 51
Offset: 1

Views

Author

Benoit Cloitre, Sep 06 2003

Keywords

Comments

If n is an odd prime a(n) = 1.

Crossrefs

Programs

  • Mathematica
    motz[0] = motz[1] = 1; motz[n_] := motz[n] = ((2*n + 1)*motz[n-1] + 3*(n-1)*motz[n-2])/(n+2); a[n_] := Mod[motz[n], n]; Array[a, 100] (* Amiram Eldar, Apr 20 2025 *)

Formula

a(n) = 0 if and only if n is in A266969. - Amiram Eldar, Apr 20 2025

Extensions

Data corrected by Amiram Eldar, Apr 20 2025

A092832 Prime Motzkin numbers (see A001006).

Original entry on oeis.org

2, 127, 15511, 953467954114363
Offset: 1

Views

Author

Eric W. Weisstein, Mar 06 2004

Keywords

Crossrefs

Programs

  • Mathematica
    a[0]=1;a[n_Integer]:=a[n]=a[n-1]+Sum[a[k]*a[n-2-k], {k, 0, n-2}];lst={};Do[If[PrimeQ[p=a[n]], AppendTo[lst, p]], {n, 10^2}];lst (* Vladimir Joseph Stephan Orlovsky, Aug 21 2008 *)

A144218 Equals product A*B, where A is an infinite lower triangular matrix with A086246 in every column and B is the diagonal matrix with A001006 as diagonal.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 2, 1, 2, 4, 4, 2, 2, 4, 9, 9, 4, 4, 4, 9, 21, 21, 9, 8, 8, 9, 21, 51, 51, 21, 18, 16, 18, 21, 51, 127, 127, 51, 42, 36, 36, 42, 51, 127, 323, 323, 127, 102, 84, 81, 84, 102, 127, 323, 835, 835, 323, 254, 204, 189, 189, 204, 254, 323, 835, 2188
Offset: 0

Views

Author

Gary W. Adamson, Sep 14 2008

Keywords

Comments

Right border is A001006.
Row sums give A001006 without the initial 1.
Left border is A086246 (A001006 with an additional leading 1).
Sum of n-th row terms = rightmost term of next row.

Examples

			First few rows of the triangle:
    1;
    1,   1;
    1,   1,   2;
    2,   1,   2,   4;
    4,   2,   2,   4,   9;
    9,   4,   4,   4,   9,  21;
   21,   9,   8,   8,   9,  21,  51;
   51,  21,  18,  16,  18,  21,  51, 127;
  127,  51,  42,  36,  36,  42,  51, 127, 323;
  323, 127, 102,  84,  81,  84, 102, 127, 323, 835;
  835, 323, 254, 204, 189, 189, 204, 254, 323, 835, 2188;
  ...
Row 4 = (4, 2, 2, 4, 9) = termwise products of (4, 2, 1, 1, 1) and (1, 1, 2, 4, 9) = (4*1, 2*1, 1*2, 1*4, 1*9).
		

Crossrefs

Programs

  • Mathematica
    nmax = 10;
    T[0, 0] = T[1, 0] = 1;
    T[n_, 0]  := Hypergeometric2F1[3/2, 1-n, 3, 4] // Abs;
    T[n_, n_] := Hypergeometric2F1[(1-n)/2, -n/2, 2, 4];
    row[n_] := row[n] = Table[T[m, 0], {m, n, 0, -1}]*Table[T[m, m], {m, 0, n} ];
    T[n_, k_] /; 0Jean-François Alcover, Aug 07 2018 *)

Extensions

Edited by Joerg Arndt, Jan 26 2024
Previous Showing 31-40 of 590 results. Next