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.

A224958 Number of compositions [p(1), p(2), ..., p(k)] of n such that p(j) != p(j-2).

Original entry on oeis.org

1, 1, 2, 3, 6, 9, 18, 29, 53, 91, 162, 277, 495, 855, 1508, 2625, 4618, 8049, 14130, 24675, 43255, 75621, 132475, 231697, 405751, 709887, 1242824, 2174763, 3806989, 6662291, 11661737, 20409409, 35723307, 62521919, 109431810, 191527623, 335225350, 586717615
Offset: 0

Views

Author

Joerg Arndt, Apr 21 2013

Keywords

Examples

			The a(6) = 18 such compositions of 6 are
01:  [ 1 1 2 2 ]
02:  [ 1 1 4 ]
03:  [ 1 2 2 1 ]
04:  [ 1 2 3 ]
05:  [ 1 3 2 ]
06:  [ 1 5 ]
07:  [ 2 1 1 2 ]
08:  [ 2 1 3 ]
09:  [ 2 2 1 1 ]
10:  [ 2 3 1 ]
11:  [ 2 4 ]
12:  [ 3 1 2 ]
13:  [ 3 2 1 ]
14:  [ 3 3 ]
15:  [ 4 1 1 ]
16:  [ 4 2 ]
17:  [ 5 1 ]
18:  [ 6 ]
		

Crossrefs

Cf. A000726 (partitions such that p(j) != p(j-2)), A003242, A241902.

Programs

  • Maple
    b:= proc(n, i, j) option remember; `if`(n=0, 1, add(`if`(k=j, 0,
          b(n-k, `if`(n-k b(n, 0, 0):
    seq(a(n), n=0..50);  # Alois P. Heinz, May 02 2013
  • Mathematica
    b[n_, i_, j_] := b[n, i, j] = If[n==0, 1, Sum[If[k==j, 0, b[n-k, If[n-k < k, 0, k], If[n-k < i, 0, i]]], {k, 1, n}]]; a[n_] := b[n, 0, 0]; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Apr 08 2015, after Alois P. Heinz *)

Formula

a(n) ~ c * d^n, where d = 1.7502412917183090312497386246... (see A241902) and c = 0.5940298439978189763822100914... - Vaclav Kotesovec, May 01 2014