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 A166012 #24 Jan 25 2023 11:51:32 %S A166012 1,2,3,4,7,10,17,26,43,68,111,178,289,466,755,1220,1975,3194,5169, %T A166012 8362,13531,21892,35423,57314,92737,150050,242787,392836,635623, %U A166012 1028458,1664081,2692538,4356619,7049156,11405775,18454930,29860705,48315634,78176339 %N A166012 a(n) = 2*(A000045(n)-(n mod 2)) + 1 + (n mod 2). %C A166012 This is an auxiliary sequence for computing A138606. %H A166012 G. C. Greubel, <a href="/A166012/b166012.txt">Table of n, a(n) for n = 0..1000</a> %H A166012 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (1,2,-1,-1). %F A166012 a(2n) = 2*A000045(2n) + 1, a(2n+1) = 2*A000045(2n+1). %F A166012 Without reference to A000045: a(n)=2*Floor(a(n-1)/2)+a(n-2). - _Clark Kimberling_, Nov 07 2009 %F A166012 If n mod 2 = 0 then a(n) = a(n-1) + a(n-2), else a(n) = a(n-1) + a(n-2) - 1. %F A166012 a(n) = 2*Fibonacci(n) + (1+(-1)^n)/2. %F A166012 a(n) = 2*Fibonacci(n) + [(n+1)mod 2]. - _Gary Detlefs_, Dec 29 2010 %F A166012 G.f.: (1 + x - x^2 - 2*x^3)/((1 - x^2)*(1 - x - x^2)). - _Ilya Gutkovskiy_, Apr 22 2016 %F A166012 From _Colin Barker_, Apr 22 2016: (Start) %F A166012 a(n) = a(n-1)+2*a(n-2)-a(n-3)-a(n-4) for n>3. %F A166012 a(n) = (1/2+(-1)^n/2-(2*((1/2*(1-sqrt(5)))^n-(1/2*(1+sqrt(5)))^n))/sqrt(5)). %F A166012 (End) %t A166012 Table[2*Fibonacci[n] + (1 + (-1)^n)/2, {n, 0, 100}] (* _G. C. Greubel_, Apr 21 2016 *) %t A166012 LinearRecurrence[{1,2,-1,-1},{1,2,3,4},40] (* _Harvey P. Dale_, May 01 2018 *) %o A166012 (MIT Scheme:) (define (A166012 n) (+ 1 (modulo n 2) (* 2 (- (A000045 n) (modulo n 2))))) %o A166012 (PARI) Vec((1+x-x^2-2*x^3)/((1-x)*(1+x)*(1-x-x^2)) + O(x^50)) \\ _Colin Barker_, Apr 22 2016 %K A166012 nonn,easy %O A166012 0,2 %A A166012 _Antti Karttunen_, Oct 05 2009