%I #8 Sep 25 2015 08:27:34
%S 1,24,70,206,608,1798,5324,15780,46806,138918,412508,1225432,3641690,
%T 10825628,32190154,95741294,284820048,847475910,2522096172,7507000776,
%U 22347852666,66537181776,198128815230,590039959434,1757365514652
%N Number of base 24 n-digit numbers with adjacent digits differing by one or less.
%C [Empirical] a(base,n)=a(base-1,n)+3^(n-1) for base>=n; a(base,n)=a(base-1,n)+3^(n-1)-2 when base=n-1
%H Alois P. Heinz, <a href="/A126378/b126378.txt">Table of n, a(n) for n = 0..1000</a>
%F G.f.: -(7*x^12 +92*x^11 -206*x^10 -680*x^9 +1145*x^8 +946*x^7 -2100*x^6 +318*x^5 +1050*x^4 -725*x^3 +176*x^2 -11*x -1) / ((x^2 -3*x +1)*(x^10 +15*x^9 +10*x^8 -65*x^7 -10*x^6 +97*x^5 -35*x^4 -40*x^3 +35*x^2 -10*x +1)). - _Alois P. Heinz_, Sep 25 2015
%p b:= proc(n, i) option remember; `if`(n=0, 1, add(
%p `if`(i=0 or abs(i-j)<2, b(n-1, j), 0), j=1..24))
%p end:
%p a:= n-> b(n, 0):
%p seq(a(n), n=0..20); # _Alois P. Heinz_, Sep 25 2015
%o (S/R) stvar $[N]:(0..M-1) init $[]:=0 asgn $[]->{*} kill +[i in 0..N-2](($[i]`-$[i+1]`>1)+($[i+1]`-$[i]`>1))
%K nonn,base
%O 0,2
%A _R. H. Hardin_, Dec 26 2006