A329745 Number of compositions of n with runs-resistance 2.
0, 0, 2, 3, 6, 15, 22, 41, 72, 129, 213, 395, 660, 1173, 2031, 3582, 6188, 10927, 18977, 33333, 58153, 101954, 178044, 312080, 545475, 955317, 1670990, 2925711, 5118558, 8960938, 15680072, 27447344, 48033498, 84076139, 147142492, 257546234, 450748482, 788937188
Offset: 1
Keywords
Examples
The a(3) = 2 through a(6) = 15 compositions: (1,2) (1,3) (1,4) (1,5) (2,1) (3,1) (2,3) (2,4) (1,2,1) (3,2) (4,2) (4,1) (5,1) (1,3,1) (1,2,3) (2,1,2) (1,3,2) (1,4,1) (2,1,3) (2,3,1) (3,1,2) (3,2,1) (1,1,2,2) (1,2,1,2) (2,1,2,1) (2,2,1,1)
Links
- Andrew Howroyd, Table of n, a(n) for n = 1..1000
Crossrefs
Programs
-
Mathematica
runsres[q_]:=Length[NestWhileList[Length/@Split[#]&,q,Length[#]>1&]]-1; Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],runsres[#]==2&]],{n,10}]
-
PARI
seq(n)={my(b=Vec(1/(1 - sum(k=1, n, x^k/(1+x^k) + O(x*x^n)))-1)); vector(n, k, sumdiv(k, d, b[d]-1))} \\ Andrew Howroyd, Dec 30 2020
Formula
a(n) = Sum_{d|n} (A003242(d) - 1). - Andrew Howroyd, Dec 30 2020
Extensions
Terms a(21) and beyond from Andrew Howroyd, Dec 30 2020
Comments