This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A024630 n written in fractional base 4/2. 1
 0, 1, 2, 3, 20, 21, 22, 23, 200, 201, 202, 203, 220, 221, 222, 223, 2000, 2001, 2002, 2003, 2020, 2021, 2022, 2023, 2200, 2201, 2202, 2203, 2220, 2221, 2222, 2223, 20000, 20001, 20002, 20003, 20020, 20021, 20022, 20023, 20200, 20201, 20202, 20203, 20220, 20221 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,3 LINKS G. C. Greubel, Table of n, a(n) for n = 0..1000 FORMULA To represent a number in base b, if a digit exceeds b, subtract b and carry 1. In fractional base a/b, subtract a and carry b. MAPLE a:= proc(n) `if`(n<1, 0, irem(n, 4, 'q')+a(2*q)*10) end: seq(a(n), n=0..45);  # Alois P. Heinz, Aug 20 2019 MATHEMATICA p:=4; q:=2; a[n_]:= a[n]= If[n==0, 0, 10*a[q*Floor[n/p]] + Mod[n, p]]; Table[a[n], {n, 0, 50}] (* G. C. Greubel, Aug 20 2019 *) PROG (PARI) a(n) = p=4; q=2; if(n==0, 0, 10*a(q*(n\p)) + (n%p)); vector(50, n, n--; a(n)) \\ G. C. Greubel, Aug 20 2019 (Sage) def basepqExpansion(p, q, n):     L, i = [n], 1     while L[i-1] >= p:         x=L[i-1]         L[i-1]=x.mod(p)         L.append(q*floor(x/p))         i+=1     L.reverse()     return Integer(''.join([str(x) for x in L])) [basepqExpansion(4, 2, n) for n in [0..50]] # G. C. Greubel, Aug 20 2019 CROSSREFS Cf. A024629. Sequence in context: A089181 A028425 A224987 * A032809 A279180 A279471 Adjacent sequences:  A024627 A024628 A024629 * A024631 A024632 A024633 KEYWORD nonn,base AUTHOR STATUS approved

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

Last modified October 14 05:08 EDT 2019. Contains 327995 sequences. (Running on oeis4.)