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!)
A065362 Rebase n from 4 to 2. Replace 4^k with 2^k in quaternary expansion of n. 2
1, 2, 3, 2, 3, 4, 5, 4, 5, 6, 7, 6, 7, 8, 9, 4, 5, 6, 7, 6, 7, 8, 9, 8, 9, 10, 11, 10, 11, 12, 13, 8, 9, 10, 11, 10, 11, 12, 13, 12, 13, 14, 15, 14, 15, 16, 17, 12, 13, 14, 15, 14, 15, 16, 17, 16, 17, 18, 19, 18, 19, 20, 21, 8, 9, 10, 11, 10, 11, 12, 13, 12, 13, 14, 15, 14, 15, 16, 17 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Notation: (4)[n](2).
LINKS
FORMULA
a(n) = 2*a(n/4) if n == 0 (mod 4); otherwise, a(n) = a(n-1) + 1. - Clark Kimberling, Aug 03 2012
EXAMPLE
24 = 120 -> 1(4) + 2(2) + 0(1) = 8 = a(24).
MATHEMATICA
t = Table[FromDigits[RealDigits[n, 4], 2], {n, 1, 100}] (* Clark Kimberling, Aug 02 2012 *)
PROG
(PARI) Rebase(x, b, c)= { local(d, e=0, f=1); while (x>0, d=x-b*(x\b); x\=b; e+=d*f; f*=c); return(e) } { for (n=1, 1000, write("b065362.txt", n, " ", Rebase(n, 4, 2)) ) } \\ Harry J. Smith, Oct 17 2009
(Julia)
function a(n)
m, r, b = n, 0, 1
while m > 0
m, q = divrem(m, 4)
r += b * q
b *= 2
end
r end; [a(n) for n in 0:79] |> println # Peter Luschny, Jan 03 2021
CROSSREFS
Cf. A065361.
Sequence in context: A276439 A282701 A095207 * A083219 A106249 A110516
KEYWORD
base,easy,nonn
AUTHOR
Marc LeBrun, Oct 31 2001
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 March 28 08:12 EDT 2024. Contains 371236 sequences. (Running on oeis4.)