OFFSET
0,3
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..10000
Eric Weisstein's World of Mathematics, Palindromic Number
Eric Weisstein's World of Mathematics, Partition
EXAMPLE
n=12: there are A000041(12)=77 partitions of 12, 3 of them contain non-palindromes: 12=10+2, 12=10+1+1 and 12 itself, therefore a(12)=77-3=74.
MAPLE
p:= proc(n) option remember; local i, s; s:= ""||n;
for i to iquo(length(s), 2) do if
s[i]<>s[-i] then return false fi od; true
end:
h:= proc(n) option remember; `if`(n<1, 0,
`if`(p(n), n, h(n-1)))
end:
b:= proc(n, i) option remember; `if`(n=0 or i=1, 1,
b(n, h(i-1))+b(n-i, h(min(n-i, i))))
end:
a:= n-> b(n, h(n)):
seq(a(n), n=0..100); # Alois P. Heinz, Sep 19 2018
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Reinhard Zumkeller, Jan 22 2004
EXTENSIONS
a(0)=1 prepended by Alois P. Heinz, Sep 17 2018
STATUS
approved