login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A050128 a(n) = floor(a(n-1)/2) if this is not among 0, a(1), ..., a(n-1); otherwise a(n) = 2*n. 9

%I #23 Feb 09 2020 15:31:39

%S 1,4,2,8,10,5,14,7,3,20,22,11,26,13,6,32,16,36,18,9,42,21,46,23,50,25,

%T 12,56,28,60,30,15,66,33,70,35,17,76,38,19,82,41,86,43,90,45,94,47,98,

%U 49,24,104,52,108,54,27,114,57,118,59,29,124

%N a(n) = floor(a(n-1)/2) if this is not among 0, a(1), ..., a(n-1); otherwise a(n) = 2*n.

%C Does this sequence contain every positive integer exactly once?

%H Robert Israel, <a href="/A050128/b050128.txt">Table of n, a(n) for n = 1..10000</a>

%p N:= 100: # for a(1)..a(N)

%p V:= Vector(N): S:= {0,1}:

%p V[1]:= 1:

%p for n from 2 to N do

%p v:= floor(V[n-1]/2);

%p if member(v, S) then V[n]:= 2*n

%p else V[n]:= v

%p fi;

%p S:= S union {V[n]}

%p od:

%p convert(V,list); # _Robert Israel_, Feb 09 2020

%t f[s_List] := Block[{len = Length@s, m = Floor[s[[-1]]/2]}, Append[s, If[MemberQ[s, m], 2 len, m]]]; Rest@Nest[f, {0, 1}, 65] (* _Robert G. Wilson v_, Aug 09 2018 *)

%Y Cf. A050000, A050129, A050130, A050131, A050132.

%K nonn,look

%O 1,2

%A _Clark Kimberling_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 12:33 EDT 2024. Contains 371969 sequences. (Running on oeis4.)