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 A378203 #19 Nov 21 2024 22:27:54 %S A378203 1,1,1,5,7,61,91,1105,1695,26281,40951,771561,1214423,26916709, %T A378203 42664987,1087101569,1732076671,49868399761,79771413871,2560599031177, %U A378203 4108933742199,145477500542221,234040800869107,9059621800971105,14605723004036255,613627780919407801 %N A378203 Number of palindromic n-ary words of length n that include the last letter of their respective alphabet. %F A378203 a(n) = n^h(n) - (n-1)^h(n) for n > 0, where h(n) = ceiling(n/2). %F A378203 a(n) = A047969(n-1,h(n)-1) for n > 0. %e A378203 a(0) = 1: (). %e A378203 a(1) = 1: (a). %e A378203 a(2) = 1: (b,b). %e A378203 a(3) = 5: (a,c,a), (b,c,b), (c,a,c), (c,b,c), (c,c,c). %p A378203 a:= n-> (h-> n^h-`if`(n=0, 0, (n-1)^h))(ceil(n/2)): %p A378203 seq(a(n), n=0..25); # _Alois P. Heinz_, Nov 21 2024 %t A378203 h[n_] := Ceiling[n/2];a[n_] := n^h[n] - (n - 1)^h[n];Join[{1},Table[a[n],{n,25}]] (* _James C. McMahon_, Nov 21 2024 *) %o A378203 (PARI) %o A378203 h(n) = {ceil(n/2)} %o A378203 a(n) = {n^h(n)-(n-1)^h(n)} %o A378203 (Python) %o A378203 def A378203(n): return n**(m:=n+1>>1)-(n-1)**m if n else 1 # _Chai Wah Wu_, Nov 21 2024 %Y A378203 Cf. A045531, A047969, A248828, A252764, A292845. %K A378203 nonn,easy %O A378203 0,4 %A A378203 _John Tyler Rascoe_, Nov 19 2024