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!)
A122586 Leading digit of n expressed in base 3. 7
1, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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
Values 1 and 2 appear alternately and each time in runs whose lengths are the powers of 3. Each power of 3 is used twice: once for a run of 1's and then for a run of 2's.
LINKS
FORMULA
a(n) = floor(n/(3^floor(log(n)/log(3)))).
From Robert Israel, Mar 15 2017: (Start)
a(3n) = a(3n+1) = a(3n+2) = a(n).
G.f.: g(x) satisfies g(x) = x + 2 x^2 + (1+x+x^2) g(x^3). (End)
EXAMPLE
a(1) = 1/(3^0) = 1.
MAPLE
seq( evalf(floor(n/ (3^floor(log[3](n))))), n=1..500);
MATHEMATICA
Table[IntegerDigits[n, 3][[1]], {n, 110}] (* or *) Table[{PadRight[{}, 3^k, 1], PadRight[ {}, 3^k, 2]}, {k, 0, 4}]//Flatten (* Harvey P. Dale, Mar 12 2023 *)
CROSSREFS
Sequence in context: A145705 A029339 A029364 * A079487 A229122 A069010
KEYWORD
easy,nonn,base
AUTHOR
Peter C. Heinig (algorithms(AT)gmx.de), Oct 20 2006
EXTENSIONS
Name changed by Franklin T. Adams-Watters, Sep 29 2011
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 25 10:51 EDT 2024. Contains 371967 sequences. (Running on oeis4.)