The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A372289 a(n) = n*(2^e) + ((4^e)-1)/3, where e is the 2-adic valuation of n. 2
1, 5, 3, 21, 5, 13, 7, 85, 9, 21, 11, 53, 13, 29, 15, 341, 17, 37, 19, 85, 21, 45, 23, 213, 25, 53, 27, 117, 29, 61, 31, 1365, 33, 69, 35, 149, 37, 77, 39, 341, 41, 85, 43, 181, 45, 93, 47, 853, 49, 101, 51, 213, 53, 109, 55, 469, 57, 117, 59, 245, 61, 125, 63, 5461 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Construction: take the binary expansion of n, and substitute "01" for all trailing 0-bits that follow after its odd part (= A000265(n)). See the examples.
LINKS
FORMULA
For n >= 0, a(2n+1) = 2n+1.
EXAMPLE
For n=4, "100" in binary, when we substitute 01's for the two trailing 0's, we obtain 21, "10101" in binary, therefore a(4) = 21.
For n=11, "1011" in binary, there are no trailing 0's, and thus no changes, therefore a(11) = 11.
MAPLE
a := proc(n) padic[ordp](n, 2): n*2^% + ((2^%)^2 - 1)/3 end:
seq(a(n), n = 1..64); # Peter Luschny, Apr 27 2024
MATHEMATICA
a[n_]:=n*(2^IntegerExponent[n, 2]) + ((4^IntegerExponent[n, 2]) - 1)/3; Array[a, 75] (* Stefano Spezia, Apr 26 2024 *)
PROG
(PARI) A372289(n) = { my(e=valuation(n, 2)); ((n*(2^e)) + (((4^e)-1)/3)); };
(Python)
def A372289(n): return (n<<(e:=(~n & n-1).bit_length()))+((1<<(e<<1))-1)//3 # Chai Wah Wu, Apr 26 2024
CROSSREFS
Cf. A000265, A005408 (odd bisection), A007814, A371094 [= a(3n+1)].
Sequence in context: A049457 A061037 A070262 * A171621 A084183 A099730
KEYWORD
nonn
AUTHOR
Antti Karttunen and Ali Sada, Apr 26 2024
STATUS
approved

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 May 20 05:07 EDT 2024. Contains 372703 sequences. (Running on oeis4.)