A240737 Number of compositions of n having exactly two fixed points.
1, 1, 3, 4, 12, 23, 47, 100, 198, 404, 818, 1652, 3319, 6686, 13426, 26947, 54043, 108331, 217059, 434731, 870472, 1742558, 3487710, 6979593, 13965902, 27942597, 55902624, 111833288, 223711791, 447496476, 895110536, 1790410758, 3581127635, 7162749398
Offset: 3
Keywords
Examples
a(5) = 3: 113, 122, 1211. a(6) = 4: 1131, 1212, 1221, 12111. a(7) = 12: 124, 133, 223, 1114, 1132, 1213, 1222, 11311, 12112, 12121, 12211, 121111.
Links
- Joerg Arndt and Alois P. Heinz, Table of n, a(n) for n = 3..1000
- M. Archibald, A. Blecher, and A. Knopfmacher, Fixed Points in Compositions and Words, J. Int. Seq., Vol. 23 (2020), Article 20.11.1.
Programs
-
Maple
b:= proc(n, i) option remember; `if`(n=0, 1, series( add(b(n-j, i+1)*`if`(i=j, x, 1), j=1..n), x, 3)) end: a:= n-> coeff(b(n, 1), x, 2): seq(a(n), n=3..40);
-
Mathematica
b[n_, i_] := b[n, i] = If[n == 0, 1, Series[Sum[b[n-j, i+1]*If[i == j, x, 1], {j, 1, n}], {x, 0, 3}]]; a[n_] := SeriesCoefficient[b[n, 1], {x, 0, 2}]; Table[a[n], {n, 3, 40}] (* Jean-François Alcover, Nov 07 2014, after Maple *)
Formula
a(n) ~ c * 2^n, where c = 0.10426192955737153473390619611670767950197436882607451088699497466613223911... . - Vaclav Kotesovec, Sep 07 2014