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 A095343 #23 Jul 02 2023 18:45:35 %S A095343 1,1,7,7,31,49,145,289,727,1591,3775,8545,19873,45505,105127,241639, %T A095343 557023,1281937,2953009,6798817,15657847,36054295,83027839,191190721, %U A095343 440274241,1013846401,2334669127,5376208327,12380215711,28508840689 %N A095343 Length of n-th string generated by a Kolakoski(7,1) rule starting with a(1)=1. %C A095343 Each string is derived from the previous string using the Kolakoski(7,1) rule and the additional condition: "string begins with 1 if previous string ends with 5 and vice versa". The strings are 1 -> 7 -> 1111111 -> 7171717 -> 11111117111111171111111711111117 -> ... and each one contains 1,1,7,7,31,... elements. %H A095343 G. C. Greubel, <a href="/A095343/b095343.txt">Table of n, a(n) for n = 1..1000</a> %H A095343 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (0, 4, 3). %F A095343 a(1) = a(2) = 1, a(n) = a(n-1) + 3*a(n-2) - 3*(-1)^n. %F A095343 G.f.: x*(1+x+3*x^2)/((1+x)*(1-x-3*x^2)). - _Colin Barker_, Jul 02 2012 %F A095343 a(n) = 3*(-1)^n + 2*(sqrt(3)/i)^n*(sqrt(3)*i*ChebyshevU(n, i/(2*sqrt(3))) - ChebyshevU(n-1, i/(2*sqrt(3)))). - _G. C. Greubel_, Dec 26 2019 %p A095343 seq(coeff(series(x*(1+x+3*x^2)/((1+x)*(1-x-3*x^2)), x, n+1), x, n), n = 0..35); # _G. C. Greubel_, Dec 26 2019 %t A095343 Table[ 3*(-1)^n + 2*Sqrt[3]^n*(Sqrt[3]*Fibonacci[n, 1/Sqrt[3]] - Fibonacci[n+1, 1/Sqrt[3]]), {n,35}]//FullSimplify (* _G. C. Greubel_, Dec 26 2019 *) %o A095343 (PARI) vector(35, n, round(3*(-1)^n + 2*(sqrt(3)/I)^n*(sqrt(3)*I* polchebyshev(n-1, 2, I/(2*sqrt(3))) - polchebyshev(n, 2, I/(2*sqrt(3)))) )) \\ _G. C. Greubel_, Dec 26 2019 %o A095343 (Magma) I:=[1,1]; [n le 2 select I[n] else Self(n-1) + 3*Self(n-2) - 3*(-1)^n: n in [1..35]]; // _G. C. Greubel_, Dec 26 2019 %o A095343 (Sage) %o A095343 def A095343_list(prec): %o A095343 P.<x> = PowerSeriesRing(ZZ, prec) %o A095343 return P( x*(1+x+3*x^2)/((1+x)*(1-x-3*x^2)) ).list() %o A095343 a=A095343_list(35); a[1:] # _G. C. Greubel_, Dec 26 2019 %o A095343 (GAP) a:=[1,1];; for n in [3..35] do a[n]:=a[n-1]-3*a[n-2]-3*(-1)^n; od; a; # _G. C. Greubel_, Dec 26 2019 %Y A095343 Cf. A000002, A066983, A095342, A095344. %K A095343 nonn %O A095343 1,3 %A A095343 _Benoit Cloitre_, Jun 03 2004