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 A386359 #12 Jul 24 2025 05:09:00 %S A386359 0,1,13,151,1513,14251,130813,1187551,10728913,96724051,871171813, %T A386359 7843167751,70598995513,635432902651,5719063896013,51472246152751, %U A386359 463252899729313,4169286834982051,37523624464511413,337712791979294551,3039415815008418313,27354745083854834251 %N A386359 a(n) = (1/4)*(9^n - 2*4^n + 3), n > 0; a(0) = 0. %C A386359 a(n) is the number of ternary strings of length 2*n with an even number of 1's and 2's (possibly zero) and a positive even number of 0's. %H A386359 Vincenzo Librandi, <a href="/A386359/b386359.txt">Table of n, a(n) for n = 0..300</a> %H A386359 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (14,-49,36). %F A386359 a(n) = 14*a(n-1) - 49*a(n-2) + 36*a(n-3), n > 3. %F A386359 G.f.: (18*x^3 - x^2 + x)/((1 - 9*x)*(1 - 4*x)*(1 - x)). %F A386359 E.g.f.: (1/4)*(exp(9*x) - 2*exp(4*x) + 3*exp(x) - 2). %e A386359 For n=2, a(2)=13 since the strings of length 4 are (number of permutations in parentheses): 0022 (6), 0011 (6), 0000 (1). %e A386359 For n=3, a(3)=151 since the strings of length 6 are (number of permutations in parentheses): 000000 (1), 000022 (15), 002222(15), 000011 (15), 001111 (15), 001122 (90). %t A386359 LinearRecurrence[{14,-49,36},{0,1,13,151},23] (* _Stefano Spezia_, Jul 19 2025 *) %o A386359 (Magma) I:=[0, 1, 13, 151]; [n le 4 select I[n] else 14*Self(n-1)-49*Self(n-2)+36*Self(n-3): n in [1..30]]; // _Vincenzo Librandi_, Jul 24 2025 %Y A386359 Cf. A386227, A386293. %K A386359 nonn,easy %O A386359 0,3 %A A386359 _Enrique Navarrete_, Jul 19 2025