login
A126394
Number of base 7 n-digit numbers with adjacent digits differing by two or less.
3
1, 7, 29, 125, 543, 2363, 10287, 44787, 194995, 848979, 3696331, 16093291, 70067867, 305065387, 1328210699, 5782837835, 25177641963, 109619822123, 477268896747, 2077959947307, 9047137938475, 39389933855019
OFFSET
0,2
COMMENTS
a(base,n)=a(base-1,n)+5^(n-1) for base>=2n-1; a(base,n)=a(base-1,n)+5^(n-1)-2 when base=2n-2.
LINKS
FORMULA
G.f.: 1 -x*(7-6*x-6*x^2+4*x^3) / ( (x-1)*(2*x^3-2*x^2-4*x+1) ). - R. J. Mathar, Jun 06 2013
PROG
(S/R) stvar $[N]:(0..M-1) init $[]:=0 asgn $[]->{*} kill +[i in 0..N-2](($[i]`-$[i+1]`>2)+($[i+1]`-$[i]`>2))
CROSSREFS
Cf. Base 7 differing by one or less A126361.
Sequence in context: A327587 A055427 A048876 * A252832 A074468 A303091
KEYWORD
nonn,base
AUTHOR
R. H. Hardin, Dec 28 2006
STATUS
approved