A050137 a(1)=2; a(n) = floor(a(n-1)/2) if this is not among 0,a(1),...,a(n-1); otherwise a(n) = 2*n.
2, 1, 6, 3, 10, 5, 14, 7, 18, 9, 4, 24, 12, 28, 30, 15, 34, 17, 8, 40, 20, 44, 22, 11, 50, 25, 54, 27, 13, 60, 62, 31, 66, 33, 16, 72, 36, 76, 38, 19, 82, 41, 86, 43, 21, 92, 46, 23, 98, 49, 102, 51, 106, 53, 26, 112, 56, 116, 58, 29, 122, 61
Offset: 1
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
Maple
R:= 2: S:= {2}: a:= 2: for n from 2 to 100 do t:= floor(a/2); if t <> 0 and not member(t,S) then a:= t else a:= 2*n fi; R:= R,a; S:= S union {a}; od: R; # Robert Israel, Aug 03 2025
Comments