A090571 Duplicate of A088452.
1, 1, 1, 3, 2, 6, 5, 1, 3, 10, 7, 9, 1, 2, 6, 5, 17, 18, 11, 13, 15, 10, 2, 1, 11, 10, 7, 9, 17, 30
Offset: 1
This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
If n=4, 2n+1 = 9 = 1 + 0*2 + 0*2^2 + 1*2^3, so a(4) = 1 + 0*2 + 1*2^3 = 9.
a088442 = (+ 1) . a004514 -- Reinhard Zumkeller, Sep 26 2015
function A063694(n) if n le 1 then return n; else return 4*A063694(Floor(n/4)) + (n mod 2); end if; return A063694; end function; A088442:= func< n | 2*A063694(n) + 1 >; [A088442(n): n in [0..100]]; // G. C. Greubel, Dec 05 2022
a:=proc(n) local b: b:=convert(2*n+1,base,2): 1+sum(b[2*j]*2^(2*j-1),j=1..nops(b)/2) end: seq(a(n),n=0..100); with(Bits): seq(And(2*n+1, convert("aaaaaa", decimal, hex)) + 1, n=0..127); # Georg Fischer, Dec 03 2022
A004514[n_]:= A004514[n]= If[n==0, 0, 2*(n-A004514[Floor[n/2]])]; A088442[n_] := A004514[n] +1; Table[A088442[n], {n,0,100}] (* G. C. Greubel, Dec 05 2022 *)
def A088442(n): return ((n&((1<<(m:=n.bit_length())+(m&1))-1)//3)<<1)+1 # Chai Wah Wu, Jan 30 2023
def A063694(n): if (n<2): return n else: return 4*A063694(floor(n/4)) + (n%2) def A088442(n): return 2*A063694(n) + 1 [A088442(n) for n in range(101)] # G. C. Greubel, Dec 05 2022
a(2)=11, since people are eliminated in the order 2, 4, 6, 8, 10, 12, 9, 5, 1, 7, 3, leaving 11 as the survivor.
def A090569(n): return (n-1&((1<<(m:=(n-1).bit_length())+(m&1^1))-1)//3)+1 # Chai Wah Wu, Jan 30 2023
Comments