OFFSET
0,3
LINKS
Seiichi Manyama, Table of n, a(n) for n = 0..449
FORMULA
EXAMPLE
123 contains 3 consecutive number and 321 contains 3 consecutive number in reverse order. So a(3) = 6-2 = 4.
PROG
(PARI) my(N=30, x='x+O('x^N)); concat([0, 0], Vec(sum(k=0, N, k!*x^k*(((1-2*x^2+x^3)/(1-x^3))^k-((1-2*x+x^2)/(1-x^2))^k))))
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Feb 19 2024
STATUS
approved