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 A274499 #14 Sep 09 2024 10:46:51 %S A274499 0,0,6,18,108,324,1458,4374,17496,52488,196830,590490,2125764,6377292, %T A274499 22320522,66961566,229582512,688747536,2324522934,6973568802, %U A274499 23245229340,69735688020,230127770466,690383311398,2259436291848,6778308875544,22029503845518,66088511536554 %N A274499 Sum of the degrees of asymmetry of all ternary words of length n. %C A274499 The degree of asymmetry of a finite sequence of numbers is defined to be the number of pairs of symmetrically positioned distinct entries. Example: the degree of asymmetry of (2,7,6,4,5,7,3) is 2, counting the pairs (2,3) and (6,5). %C A274499 A sequence is palindromic if and only if its degree of asymmetry is 0. %H A274499 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (3,9,-27). %F A274499 a(n) = (1/6)*(2n - 1 + (-1)^n)*3^n. %F A274499 a(n) = Sum(k*A274498(n,k), k>=0). %F A274499 From _Chai Wah Wu_, Dec 27 2018: (Start) %F A274499 a(n) = 3*a(n-1) + 9*a(n-2) - 27*a(n-3) for n > 2. %F A274499 G.f.: 6*x^2/((3*x - 1)^2*(3*x + 1)). (End) %e A274499 a(2) = 6 because the ternary words 00, 01, 02, 10, 11, 12, 20, 21, 22 have degrees of asymmetry 0, 1, 1, 1, 0, 1, 1, 1, 0, respectively. %p A274499 a := proc (n) options operator, arrow: (1/6)*(2*n-1+(-1)^n)*3^n end proc: seq(a(n), n = 0 .. 30); %t A274499 LinearRecurrence[{3, 9, -27}, {0, 0, 6}, 28] (* _Jean-François Alcover_, Sep 09 2024 *) %Y A274499 Cf. A274496, A274497, A274498. %K A274499 nonn,easy %O A274499 0,3 %A A274499 _Emeric Deutsch_, Jul 27 2016