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 A112387 #59 May 09 2025 15:08:33 %S A112387 1,1,2,1,4,3,8,5,16,11,32,21,64,43,128,85,256,171,512,341,1024,683, %T A112387 2048,1365,4096,2731,8192,5461,16384,10923,32768,21845,65536,43691, %U A112387 131072,87381,262144,174763,524288,349525,1048576,699051,2097152,1398101,4194304 %N A112387 a(n) = 2^(n/2) if n is even and a(n-1) - a(n-2) if n is odd, a(1) = 1. %C A112387 This sequence originated from the Fibonacci sequence, but instead of adding the last two terms, you get the average. Example, if you have the initial condition a(1)=x and a(2)=y, a(3)=(x+y)/2, a(4)=(x+3y)/4, a(5)=(3x+5y)/8, a(6)=(5x+11y)/16 and so on and so forth. I used the coefficients of x and y as well as the denominator. %C A112387 As n approaches infinity a(n)/a(n+1) oscillates between the values 3/2 and 1/3. %H A112387 Harvey P. Dale, <a href="/A112387/b112387.txt">Table of n, a(n) for n = 0..1000</a> %H A112387 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (0,1,0,2). %F A112387 a(n) = 2^(n/2) if n is even, a(n) = a(n-1) - a(n-2) if n is odd, and a(1) = 1. %F A112387 a(2n) = A000079(n), a(2n-1) = A001045(n). %F A112387 G.f.: (1+x+x^2)/((1+x^2)*(1-2*x^2)). - _Joerg Arndt_, Apr 25 2021 %F A112387 a(n) = A135318(n + (-1)^n). - _Paul Curtz_, Sep 27 2023 %F A112387 E.g.f.: (3*cosh(sqrt(2)*x) + sin(x) + sqrt(2)*sinh(sqrt(2)*x))/3. - _Stefano Spezia_, Jun 30 2024 %F A112387 a(2*n) + a(2*n+1) = A048573(n); a(2*n+1) + a(2*n+2) = A001045(n+3). - _Paul Curtz_, Jan 03 2025 %p A112387 a:= proc(n) option remember; %p A112387 `if`(n::even, 2^(n/2), a(n-1)-a(n-2)) %p A112387 end: a(1):=1: %p A112387 seq(a(n), n=0..50); # _Alois P. Heinz_, Sep 27 2023 %t A112387 a[1] = 1; a[2] = 2; a[n_] := a[n] = If[ EvenQ[n], 2^(n/2), a[n - 1] - a[n - 2]]; Array[a, 43] (* _Robert G. Wilson v_, Dec 05 2005 *) %t A112387 nxt[{n_,a_,b_}]:={n+1,b,If[OddQ[n],2^((n+1)/2),b-a]}; NestList[nxt,{2,1,2},50][[All,2]] (* _Harvey P. Dale_, Jul 08 2019 *) %Y A112387 Cf. A000079, A001045, A048573, A135318. %K A112387 nonn,easy %O A112387 0,3 %A A112387 _Edwin F. Sampang_, Dec 05 2005 %E A112387 Edited and extended by _Robert G. Wilson v_, Dec 05 2005 %E A112387 a(0)=1 prepended by _Alois P. Heinz_, Sep 27 2023