cp's OEIS Frontend

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.

A065362 Rebase n from 4 to 2. Replace 4^k with 2^k in quaternary expansion of n.

This page as a plain text file.
%I A065362 #27 Jan 04 2021 01:55:10
%S A065362 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,
%T A065362 8,9,10,11,10,11,12,13,12,13,14,15,14,15,16,17,12,13,14,15,14,15,16,
%U A065362 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
%N A065362 Rebase n from 4 to 2. Replace 4^k with 2^k in quaternary expansion of n.
%C A065362 Notation: (4)[n](2).
%H A065362 Harry J. Smith, <a href="/A065362/b065362.txt">Table of n, a(n) for n = 1..1000</a>
%F A065362 a(n) = 2*a(n/4) if n == 0 (mod 4); otherwise, a(n) = a(n-1) + 1. - _Clark Kimberling_, Aug 03 2012
%e A065362 24 = 120 -> 1(4) + 2(2) + 0(1) = 8 = a(24).
%t A065362 t = Table[FromDigits[RealDigits[n, 4], 2], {n, 1, 100}] (* _Clark Kimberling_, Aug 02 2012 *)
%o A065362 (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
%o A065362 (Julia)
%o A065362 function a(n)
%o A065362     m, r, b = n, 0, 1
%o A065362     while m > 0
%o A065362         m, q = divrem(m, 4)
%o A065362         r += b * q
%o A065362         b *= 2
%o A065362     end
%o A065362 r end; [a(n) for n in 0:79] |> println # _Peter Luschny_, Jan 03 2021
%Y A065362 Cf. A065361.
%K A065362 base,easy,nonn
%O A065362 1,2
%A A065362 _Marc LeBrun_, Oct 31 2001