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 A136161 #30 Dec 31 2023 10:22:32 %S A136161 0,5,2,1,3,1,2,1,0,3,-1,-1,4,-3,-2,5,-5,-3,6,-7,-4,7,-9,-5,8,-11,-6,9, %T A136161 -13,-7,10,-15,-8,11,-17,-9,12,-19,-10,13,-21,-11,14,-23,-12,15,-25, %U A136161 -13,16,-27,-14 %N A136161 a(n) = 2*a(n-3) - a(n-6), starting a(0..5) = 0, 5, 2, 1, 3, 1. %C A136161 Consider the general recurrence a(n) = k*a(n-1) + (5-2*k)*a(n-2) + (2-k)*a(n-3). The coefficients, in k, can be used to form the triple (k, 5-2*k, 2-k). Each triple is associated with a sequence, for example (0, 5, 2) leads to A111108, A112685, ..., (1, 3, 1) leads to A051927, A097075, ..., and so on. This sequence is formed from the triples {(0, 5, 2), (1, 3, 1), (2, 1, 0), (3, -1, -1), (4, -3, -2), ...}, for k >= 0. (Comment modified by _G. C. Greubel_, Dec 31 2023). %H A136161 G. C. Greubel, <a href="/A136161/b136161.txt">Table of n, a(n) for n = 0..1000</a> %H A136161 <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,2,0,0,-1). %F A136161 G.f.: x*(5+2*x+x^2-7*x^3-3*x^4) / ( (1-x)^2*(1+x+x^2)^2 ). - _R. J. Mathar_, Jul 06 2011 %F A136161 a(3n) = n. %F A136161 a(3n+1) = 5 - 2*n. %F A136161 a(3n+3) = 2 - n. %F A136161 a(n) = (1/9)*( 27 - 2*(n+1) - 34*ChebyshevU(n, -1/2) + (-1)^n*(9*A099254(n) - 6*A099254(n-1)) ). - _G. C. Greubel_, Dec 26 2023 %t A136161 LinearRecurrence[{0,0,2,0,0,-1},{0,5,2,1,3,1},60] (* _Harvey P. Dale_, Aug 16 2012 *) %t A136161 Table[PadRight[{n, 5-2*n, 2-n}], {n,0,20}]//Flatten (* _G. C. Greubel, Dec 26 2023 *) %o A136161 (PARI) Vec(x*(5+2*x+x^2-7*x^3-3*x^4)/((1-x)^2*(1+x+x^2)^2+O(x^99))) \\ _Charles R Greathouse IV_, Jul 06 2011 %o A136161 (Magma) I:=[0,5,2,1,3,1]; [n le 6 select I[n] else 2*Self(n-3) - Self(n-6): n in [1..60]]; // _G. C. Greubel_, Dec 26 2023 %o A136161 (SageMath) %o A136161 def a(n): # a = A136161 %o A136161 if n<6: return (0,5,2,1,3,1)[n] %o A136161 else: return 2*a(n-3) - a(n-6) %o A136161 [a(n) for n in range(61)] # _G. C. Greubel_, Dec 26 2023 %Y A136161 Cf. A097076, A099254, A112685, A135138, A135997, A137241. %Y A136161 Cf. A051927, A097075, A111108, A112685. %K A136161 sign,easy %O A136161 0,2 %A A136161 _Paul Curtz_, Mar 16 2008