login
A050136
a(n) = floor(a(n-1)/2) if this is not among 0,a(1),...,a(n-1), otherwise a(n)=5*n.
5
1, 10, 5, 2, 25, 12, 6, 3, 45, 22, 11, 60, 30, 15, 7, 80, 40, 20, 95, 47, 23, 110, 55, 27, 13, 130, 65, 32, 16, 8, 4, 160, 165, 82, 41, 180, 90, 190, 195, 97, 48, 24, 215, 107, 53, 26, 235, 117, 58, 29, 14, 260, 265, 132, 66, 33, 285, 142, 71, 35, 17, 310, 155, 77, 38, 19, 9, 340, 170, 85, 42, 21
OFFSET
1,2
COMMENTS
Does this sequence contain every positive integer exactly once?
LINKS
MAPLE
S:= {0, 1}: A[1]:= 1:
for n from 2 to 100 do
v:= floor(A[n-1]/2);
if not member(v, S) then A[n]:= v
else A[n]:= 5*n
fi;
S:= S union {A[n]};
od:
seq(A[i], i=1..100); # Robert Israel, Aug 07 2018
MATHEMATICA
f[s_List] := Block[{len = Length@s, m = Floor[s[[-1]]/2]}, Append[s, If[MemberQ[s, m], 5 len, m]]]; Rest@ Nest[f, {0, 1}, 65] (* Robert G. Wilson v, Aug 07 2018 *)
CROSSREFS
KEYWORD
nonn,look
EXTENSIONS
Corrected by Robert Israel, Aug 07 2018
STATUS
approved