A050196 a(1) = 1, a(n) = floor(a(n-1)/2) if this is not among 0,a(1),...,a(n-1); otherwise a(n) = a(n-1) + a(n-2).
1, 1, 2, 3, 5, 8, 4, 12, 6, 18, 9, 27, 13, 40, 20, 10, 30, 15, 7, 22, 11, 33, 16, 49, 24, 73, 36, 109, 54, 163, 81, 244, 122, 61, 183, 91, 45, 136, 68, 34, 17, 51, 25, 76, 38, 19, 57, 28, 14, 42, 21, 63, 31, 94, 47, 23, 70, 35, 105, 52, 26
Offset: 1
Keywords
Links
- Ivan Neretin, Table of n, a(n) for n = 1..10000
Crossrefs
Cf. A050000.
Programs
-
Mathematica
Nest[Append[#, If[MemberQ[Append[#, 0], r = Quotient[#[[-1]], 2]], #[[-1]] + #[[-2]], r]] &, {1, 1}, 59] (* Ivan Neretin, Mar 02 2016 *)