A152464 Number of n-digit bouncy numbers in which every pair of adjacent digits are distinct.
0, 0, 525, 3105, 18939, 114381, 693129, 4195557, 25405586, 153820395, 931359050, 5639156409, 34143908573, 206733865761, 1251728824798, 7578945799704, 45888871327435, 277847147039527, 1682304127857000, 10185986079451152
Offset: 1
Links
- Index entries for linear recurrences with constant coefficients, signature (5,10,-20,-15,21,7,-8,-1,1).
Formula
a(n) = Sum_{i=1..9} (u(n,i) + d(n,i)) for n > 2 (0 otherwise), where
u(n,i) = Sum_{j=i+1..9} d(n-1,j) for n > 1,
d(n,i) = Sum_{j=0..i-1} u(n-1,j) for n > 1,
u(1,i) = 1, and
d(1,i) = 1.
Extensions
Correction to formula for odd negative n by Jon E. Schoenfield, Dec 22 2008
Comments