login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A265583 Array T(n,k) = k*(k-1)^(n-1) read by ascending antidiagonals; k,n >= 1. 7

%I #25 Jan 10 2024 05:04:07

%S 1,0,2,0,2,3,0,2,6,4,0,2,12,12,5,0,2,24,36,20,6,0,2,48,108,80,30,7,0,

%T 2,96,324,320,150,42,8,0,2,192,972,1280,750,252,56,9,0,2,384,2916,

%U 5120,3750,1512,392,72,10,0,2,768,8748,20480,18750,9072,2744,576,90,11

%N Array T(n,k) = k*(k-1)^(n-1) read by ascending antidiagonals; k,n >= 1.

%C T(n,k) is the number of n-letter words in a k-letter alphabet with no adjacent letters the same. The factor k represents the number of choices of the first letter, and the n-1 times repeated factor k-1 represents the choices of the next n-1 letters avoiding their predecessor.

%C The antidiagonal sums are s(d) = 1, 2, 5, 12, 31, 88, 275, 942, 3513, 14158, 61241, 282632, .. for d = n+k >= 2.

%H Robert Israel, <a href="/A265583/b265583.txt">Table of n, a(n) for n = 1..10011</a>(first 141 antidiagonals, flattened)

%F T(n,k) = k*A051129(n-1,k-1) = k*A003992(k-1,n-1).

%F G.f. for column k: k*x/(1-(k-1)*x). - _R. J. Mathar_, Dec 12 2015

%F G.f. for array: y/(y-1) - (1+1/x)*y*LerchPhi(y,1,-1/x). - _Robert Israel_, Dec 13 2018

%e 1 2 3 4 5 6 7

%e 0 2 6 12 20 30 42

%e 0 2 12 36 80 150 252

%e 0 2 24 108 320 750 1512

%e 0 2 48 324 1280 3750 9072

%e 0 2 96 972 5120 18750 54432

%e 0 2 192 2916 20480 93750 326592

%e T(3,3)=12 counts aba, abc, aca, acb, bab, bac, bca, bcb, cab, cac, cba, cbc. Words like aab or cbb are not counted.

%p A265583 := proc(n,k)

%p k*(k-1)^(n-1) ;

%p end proc:

%p seq(seq( A265583(d-k,k),k=1..d-1),d=2..13) ;

%t T[1,1] = 1; T[n_, k_] := If[k==1, 0, k*(k-1)^(n-1)]; Table[T[n-k,k], {n,2,12}, {k,1,n-1}] // Flatten (* _Amiram Eldar_, Dec 13 2018 *)

%o (PARI) T(n,k) = if(n==k==1, 1, k*(k-1)^(n-k-1) );

%o for(n=2,15, for(k=1,n-1, print1(T(n,k), ", "))) \\ _G. C. Greubel_, Aug 10 2019

%o (Magma)

%o T:= func< n,k | (n eq 1 and k eq 1) select 1 else k*(k-1)^(n-k-1) >;

%o [T(n,k): k in [1..n-1], n in [2..15]]; // _G. C. Greubel_, Aug 10 2019

%o (Sage)

%o def T(n, k):

%o if (n==k==1): return 1

%o else: return k*(k-1)^(n-k-1)

%o [[T(n, k) for k in (1..n-1)] for n in (2..15)] # _G. C. Greubel_, Aug 10 2019

%o (GAP)

%o T:= function(n,k)

%o if (n=1 and k=1) then return 1;

%o else return k*(k-1)^(n-k-1);

%o fi;

%o end;

%o Flat(List([2..15], n-> List([1..n-1], k-> T(n,k) ))); # _G. C. Greubel_, Aug 10 2019

%Y Cf. A007283 (column 3), A003946 (column 4), A003947 (column 5), A002378 (row 2), A011379 (row 3), A179824 (row 4), A055897 (diagonal), A265584.

%K nonn,tabl,easy

%O 1,3

%A _R. J. Mathar_, Dec 10 2015

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 08:13 EDT 2024. Contains 371922 sequences. (Running on oeis4.)