A301428 Number of compositions (ordered partitions) of n into prime parts such that no two adjacent parts are equal (Carlitz compositions).
1, 0, 1, 1, 0, 3, 0, 4, 3, 3, 10, 3, 16, 12, 18, 35, 24, 64, 57, 90, 137, 136, 259, 270, 416, 573, 679, 1088, 1264, 1869, 2491, 3199, 4691, 5834, 8341, 11053, 14685, 20595, 26636, 37199, 49449, 66572, 91377, 120733, 166151, 221912, 300038, 407775, 544843, 743318, 996752
Offset: 0
Keywords
Examples
a(7) = 4 because we have [7], [5, 2], [2, 5] and [2, 3, 2].
Links
Programs
-
Mathematica
nmax = 50; CoefficientList[Series[1/(1 - Sum[x^Prime[k]/(1 + x^Prime[k]), {k, 1, nmax}]), {x, 0, nmax}], x]
Formula
G.f.: 1/(1 - Sum_{k>=1} x^prime(k)/(1 + x^prime(k))).