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.

A188541 a(n) = 2 * A079500(n) - A079500(n+1).

Original entry on oeis.org

1, 0, 1, 1, 2, 2, 4, 5, 9, 14, 24, 40, 70, 120, 211, 371, 658, 1172, 2102, 3786, 6856, 12470, 22782, 41789, 76947, 142180, 263578, 490104, 913858, 1708386, 3201290, 6011962, 11313274, 21329276, 40282947, 76202831, 144370582, 273906268, 520359324, 989804122, 1884992934, 3593832942, 6859139352, 13104584156, 25061042050, 47971076906, 91906883496
Offset: 0

Views

Author

N. J. A. Sloane, Apr 03 2011

Keywords

Comments

Arises in studying a conjecture related to lunar divisors in base 2.
a(n) is the number of compositions of n where the first part is even, say, 2*f and the other parts are <= f. - Joerg Arndt, Jan 04 2024

Examples

			From _Joerg Arndt_, Jan 04 2024: (Start)
There are a(10) = 24 compositions of 10 of the specified type:
   1:  [ 2 1 1 1 1 1 1 1 1 ]
   2:  [ 4 1 1 1 1 1 1 ]
   3:  [ 4 1 1 1 1 2 ]
   4:  [ 4 1 1 1 2 1 ]
   5:  [ 4 1 1 2 1 1 ]
   6:  [ 4 1 1 2 2 ]
   7:  [ 4 1 2 1 1 1 ]
   8:  [ 4 1 2 1 2 ]
   9:  [ 4 1 2 2 1 ]
  10:  [ 4 2 1 1 1 1 ]
  11:  [ 4 2 1 1 2 ]
  12:  [ 4 2 1 2 1 ]
  13:  [ 4 2 2 1 1 ]
  14:  [ 4 2 2 2 ]
  15:  [ 6 1 1 1 1 ]
  16:  [ 6 1 1 2 ]
  17:  [ 6 1 2 1 ]
  18:  [ 6 1 3 ]
  19:  [ 6 2 1 1 ]
  20:  [ 6 2 2 ]
  21:  [ 6 3 1 ]
  22:  [ 8 1 1 ]
  23:  [ 8 2 ]
  24:  [ 10 ]
(End)
		

Crossrefs

Cf. A079500.

Programs

  • Maple
    b:= proc(n, m) option remember; `if`(n=0, 1,
          `if`(m=0, add(b(n-j, j), j=1..n),
          add(b(n-j, min(n-j, m)), j=1..min(n, m))))
        end:
    a:= n-> 2*b(n, 0)-b(n+1, 0):
    seq(a(n), n=0..46);  # Alois P. Heinz, Jan 04 2024
  • Mathematica
    b[n_, m_] := b[n, m] = If[n == 0, 1, If[m == 0, Sum[b[n-j, j], {j, 1, n}], Sum[b[n-j, Min[n-j, m]], {j, 1, Min[n, m]}]]];
    a79500[n_] := b[n, 0];
    a[n_] := -a79500[n+1] + 2 a79500[n];
    Table[a[n], {n, 0, 48}] (* Jean-François Alcover, Sep 15 2018, after Alois P. Heinz in A079500 *)
  • SageMath
    def C(n): return sum(Compositions(n, max_part=k, inner=[k]).cardinality()
                     for k in (0..n))
    def a(n): return 2*C(n) - C(n+1) if n > 0 else 1
    print([a(n) for n in (0..18)])  # Peter Luschny, Jan 04 2024

Formula

G.f.: Sum_{n>=0} x^(2*n)/(1 - Sum_{k=1..n} x^k). - Joerg Arndt, Jan 04 2024

Extensions

Offset changed to 0 by N. J. A. Sloane, Jan 04 2024 at the suggestion of Joerg Arndt.