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.

A340766 Number of ordered subsequences of {1,...,2n} containing at least n elements and such that the first differences contain only odd numbers.

Original entry on oeis.org

1, 3, 7, 17, 43, 106, 273, 678, 1759, 4389, 11430, 28614, 74685, 187433, 489926, 1231957, 3223387, 8118434, 21256897, 53609282, 140442534, 354595210, 929326086, 2348710733, 6157476873, 15575365846, 40843347873, 103392210473, 271181242774, 686944588009
Offset: 0

Views

Author

Alois P. Heinz, Jun 10 2021

Keywords

Examples

			a(3) = 17: [1,2,3], [1,2,5], [1,4,5], [2,3,4], [2,3,6], [2,5,6], [3,4,5], [4,5,6], [1,2,3,4], [1,2,3,6], [1,2,5,6], [1,4,5,6], [2,3,4,5], [3,4,5,6], [1,2,3,4,5], [2,3,4,5,6], [1,2,3,4,5,6].
		

Crossrefs

Cf. A345123.

Programs

  • Maple
    g:= proc(n, k) option remember; `if`(k>n, 0,
         `if`(k in [0, 1], n^k, g(n-1, k-1)+g(n-2, k)))
        end:
    b:= proc(n, k) option remember;
         `if`(k>n, 0, g(n, k)+b(n, k+1))
        end:
    a:= n-> b(2*n, n):
    seq(a(n), n=0..30);
  • Mathematica
    g[n_, k_] := g[n, k] = Which[k > n, 0, k == 0, 1, k == 1, n,
         True, g[n - 1, k - 1] + g[n - 2, k]];
    b[n_, k_] := b[n, k] = If[k > n, 0, g[n, k] + b[n, k + 1]];
    a[n_] := b[2*n, n];
    Table[a[n], {n, 0, 30}] (* Jean-François Alcover, May 29 2022, after Alois P. Heinz *)

Formula

a(n) = A345123(2n,n).
a(n) ~ c * (27/4)^(n/2) / sqrt(3*Pi*n/2), where c = 14 if n is even and c = 8*sqrt(3) if n is odd. Equivalently, c = 7 + 4*sqrt(3) + (7 - 4*sqrt(3))*(-1)^n. - Vaclav Kotesovec, Jun 19 2021