A120424 Having specified two initial terms, the "Half-Fibonacci" sequence proceeds like the Fibonacci sequence, except that the terms are halved before being added if they are even.
1, 3, 4, 5, 7, 12, 13, 19, 32, 35, 51, 86, 94, 90, 92, 91, 137, 228, 251, 365, 616, 673, 981, 1654, 1808, 1731, 2635, 4366, 4818, 4592, 4705, 7001, 11706, 12854, 12280, 12567, 18707, 31274, 34344, 32809, 49981, 82790, 91376, 87083, 132771, 219854
Offset: 0
Examples
Given a(21)=100 and a(22)=117, then a(23)=50+117=167. Given a(13)=64 and a(14)=68, then a(15)=32+34=66.
Links
- Harvey P. Dale, Table of n, a(n) for n = 0..1000
Crossrefs
Cf. A069202.
Programs
-
Mathematica
HalfFib[a_, b_, n_] := Module[{HF, i}, HF = {a, b}; For [i = 3, i < n, i++, HF = Append[HF, HF[[i - 2]]/(2 - Mod[HF[[i - 2]], 2]) + HF[[i - 1]]/(2 - Mod[HF[[i - 1]], 2])]]; HF] HalfFib[1,3,100] nxt[{a_,b_}]:={b,If[EvenQ[a],a/2,a]+If[EvenQ[b],b/2,b]}; NestList[nxt,{1,3},50][[All,1]] (* Harvey P. Dale, Nov 19 2019 *)
Formula
a(n) = (a(n-1) if a(n-1) is odd, else a(n-1)/2) + (a(n-2) if a(n-2) is odd, else a(n-2)/2).
Comments