login
Number of base 27 n-digit numbers with adjacent digits differing by one or less.
4

%I #5 Mar 31 2012 12:35:05

%S 1,27,79,233,689,2041,6053,17967,53367,158601,471557,1402579,4173131,

%T 12419951,36973123,110090201,327866769,976616073,2909516661,

%U 8669262243,25834637067,76997534979,229509874839,684183138261,2039795051133

%N Number of base 27 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

%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