OFFSET
0,2
COMMENTS
a(n) is also the number of anagram compositions of 2n or of 2n+1. A composition of n is an ordered sequence of positive integers whose sum is n. An anagram composition of n can be divided into two consecutive subsequences with exactly the same parts, with a central part between the subsequences permitted. - Gregory L. Simay, Oct 30 2015
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
FORMULA
a(n) = Sum_{j=0..n} A263897(j). - Gregory L. Simay, Oct 30 2015
EXAMPLE
[1,2,3,4][3,2,1,4] is an anagram composition of 20 enumerated by a(10), [3,2,1] 5 [2,1,3] is an anagram composition of 17 enumerated by a(8), [3467] 8 [7643] is an anagram composition of 48 enumerated by a(24). - Gregory L. Simay, Oct 30 2015
MAPLE
b:= proc(n, i, p) option remember; `if`(n=0, p!^2,
`if`(i<1, 0, add(b(n-i*j, i-1, p+j)/j!^2, j=0..n/i)))
end:
a:= proc(n) option remember; b(n$2, 0)+`if`(n>0, a(n-1), 0) end:
seq(a(n), n=0..30); # Alois P. Heinz, Oct 30 2015
MATHEMATICA
b[n_, i_, p_] := b[n, i, p] = If[n == 0, p!^2, If[i < 1, 0, Sum[b[n - i*j, i - 1, p + j]/j!^2, {j, 0, n/i}]]];
a[n_] := a[n] = b[n, n, 0] + If[n > 0, a[n - 1], 0];
Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Jun 04 2018, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul D. Hanna, Jul 23 2004
STATUS
approved