A102568 a(n+1) = if a(n-1)=a(n)-1 then 2*a(n) else smallest number not occurring earlier; a(1)=1, a(2)=2.
1, 2, 4, 3, 5, 6, 12, 7, 8, 16, 9, 10, 20, 11, 13, 14, 28, 15, 17, 18, 36, 19, 21, 22, 44, 23, 24, 48, 25, 26, 52, 27, 29, 30, 60, 31, 32, 64, 33, 34, 68, 35, 37, 38, 76, 39, 40, 80, 41, 42, 84, 43, 45, 46, 92, 47, 49, 50, 100, 51, 53, 54, 108, 55, 56, 112, 57, 58, 116, 59, 61
Offset: 1
Keywords
Links
Programs
-
Mathematica
Nest[Append[#, If[#[[-1]] == #[[-2]] + 1, 2 #[[-1]], Min[Complement[Range[Max[#] + 1], #]]]] &, {1, 2}, 69] (* Ivan Neretin, Sep 08 2015 *)
Comments