A199884 Number of compositions of n such that the number of parts is not divisible by the greatest part.
0, 1, 1, 6, 8, 19, 43, 90, 167, 339, 722, 1503, 2987, 5883, 11820, 24167, 49348, 99707, 199626, 398475, 797457, 1604029, 3237867, 6534327, 13143278, 26336266, 52664325, 105349525, 211135006, 423949168, 851981311, 1711365899, 3433202397, 6878160656, 13768314357
Offset: 1
Keywords
Examples
a(5) = 8: [1,2,2], [1,4], [2,1,2], [2,2,1], [2,3], [3,2], [4,1], [5].
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..250
Programs
-
Maple
b:= proc(n, t, g) option remember; `if`(n=0, `if`(irem(t, g)=0, 0, 1), add(b(n-i, t+1, max(i, g)), i=1..n)) end: a:= n-> b(n, 0, 0): seq(a(n), n=1..40);
-
Mathematica
b[n_, t_, g_] := b[n, t, g] = If[n == 0, If[Mod[t, g] == 0, 0, 1], Sum [b[n-i, t+1, Max[i, g]], {i, 1, n}]]; a[n_] := b[n, 0, 0]; Table[a[n], {n, 1, 40}] (* Jean-François Alcover, Nov 05 2014, after Alois P. Heinz *)