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!)
A105186 Replace odd-positioned digits with 0 in ternary representation of n. 1
0, 1, 2, 0, 1, 2, 0, 1, 2, 9, 10, 11, 9, 10, 11, 9, 10, 11, 18, 19, 20, 18, 19, 20, 18, 19, 20, 0, 1, 2, 0, 1, 2, 0, 1, 2, 9, 10, 11, 9, 10, 11, 9, 10, 11, 18, 19, 20, 18, 19, 20, 18, 19, 20, 0, 1, 2, 0, 1, 2, 0, 1, 2, 9, 10, 11, 9, 10, 11, 9, 10, 11, 18, 19, 20, 18, 19, 20, 18, 19, 20, 81, 82 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
FORMULA
a(n) = n - a(floor(n/3))*3, a(0) = 0.
a(n) = 9*a(floor(n/9)) + (n mod 9) mod 3. - Reinhard Zumkeller, Sep 26 2015
EXAMPLE
n = 123 = '11120' --> '10100' = 90 = a(123).
PROG
(Haskell)
a105186 0 = 0
a105186 n = 9 * a105186 n' + mod t 3
where (n', t) = divMod n 9
-- Reinhard Zumkeller, Sep 26 2015
(PARI) a(n) = fromdigits(digits(n, 9)%3, 9); \\ Kevin Ryde, May 20 2020
CROSSREFS
Sequence in context: A025685 A194515 A163325 * A328346 A238406 A058709
KEYWORD
nonn,base
AUTHOR
Reinhard Zumkeller, Apr 11 2005
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 24 20:08 EDT 2024. Contains 371963 sequences. (Running on oeis4.)