This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A265584 #17 Mar 26 2020 07:06:14 %S A265584 1,1,2,0,4,3,0,6,9,4,0,10,24,16,5,0,16,66,60,25,6,0,26,180,228,120,36, %T A265584 7,0,42,492,864,580,210,49,8,0,68,1344,3276,2800,1230,336,64,9,0,110, %U A265584 3672,12420,13520,7200,2310,504,81,10,0,178,10032,47088,65280,42150,15876,3976,720,100,11 %N A265584 Array T(n,k) counting words with n letters drawn from a k-letter alphabet with no letter appearing thrice in a 3-letter subword. %C A265584 The antidiagonal sums are s(d) = 1, 3, 7, 19, 55, 173, 597, 2245, 9127, 39827, 185411, 916177, 4784217,.. at index d=n+k >=2. %F A265584 T(4,k) = k*(k-1)*(k^2+k-1). %F A265584 T(5,k) = k^2*(k+2)*(k-1)^2. %F A265584 T(6,k) = k*(k^3+2*k^2-k-1)*(k-1)^2. %F A265584 T(7,k) = k*(k+1)*(k^2+2*k-1)*(k-1)^3. %e A265584 1 2 3 4 5 6 7 8 %e A265584 1 4 9 16 25 36 49 64 %e A265584 0 6 24 60 120 210 336 504 %e A265584 0 10 66 228 580 1230 2310 3976 %e A265584 0 16 180 864 2800 7200 15876 31360 %e A265584 0 26 492 3276 13520 42150 109116 247352 %e A265584 0 42 1344 12420 65280 246750 749952 1950984 %e A265584 0 68 3672 47088 315200 1444500 5154408 15388352 %e A265584 T(3,2) =6 counts the 3-letter words aab, aba, abb, bba, bab, baa. The words aaa and bbb are not counted. %p A265584 A265584 := proc(n,k) %p A265584 (1+x+x^2)/(1-(k-1)*x-(k-1)*x^2) ; %p A265584 coeftayl(%,x=0,n) ; %p A265584 end proc: %p A265584 seq(seq( A265584(d-k,k),k=1..d-1),d=2..13) ; %t A265584 T[n_, k_] := SeriesCoefficient[(1+x+x^2)/(1-(k-1)*x-(k-1)*x^2), {x, 0, n}]; %t A265584 Table[T[n-k, k], {n, 2, 12}, {k, 1, n-1}] // Flatten (* _Jean-François Alcover_, Mar 26 2020, from Maple *) %Y A265584 Cf. A265583 (no letter twice), A265624. A000290 (row 2), A007531 (row 3), A006355 (column 2), A121907 (column 3), A123620 (column 4), A123871 (column 5), A123887 (column 6). %K A265584 nonn,tabl,easy %O A265584 1,3 %A A265584 _R. J. Mathar_, Dec 10 2015