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!)
A122587 Leading digit of n in base 4. 5
1, 2, 3, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Digits 1, 2 and 3 appear cyclically and each time in runs whose lengths are the powers of 4.
LINKS
FORMULA
a(n) = floor(n/(4^floor(log[4](n)))).
EXAMPLE
a(1) = 1/(4^0) = 1.
MAPLE
seq( evalf(floor(n/ (4^floor(log[4](n))))), n=1..500);
MATHEMATICA
Table[First[IntegerDigits[n, 4]], {n, 100}] (* Alonso del Arte, Sep 30 2011 *)
PROG
(Python)
def A122587(n): return int(bin(n)[2:3+(n.bit_length()&1^1)], 2) # Chai Wah Wu, Jan 30 2023
CROSSREFS
Sequence in context: A337201 A327462 A255824 * A276333 A347380 A308638
KEYWORD
easy,nonn,base
AUTHOR
Peter C. Heinig (algorithms(AT)gmx.de), Oct 20 2006
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 April 23 10:13 EDT 2024. Contains 371905 sequences. (Running on oeis4.)