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!)
A244042 In ternary representation of n, replace 2's with 0's. 7
0, 1, 0, 3, 4, 3, 0, 1, 0, 9, 10, 9, 12, 13, 12, 9, 10, 9, 0, 1, 0, 3, 4, 3, 0, 1, 0, 27, 28, 27, 30, 31, 30, 27, 28, 27, 36, 37, 36, 39, 40, 39, 36, 37, 36, 27, 28, 27, 30, 31, 30, 27, 28, 27, 0, 1, 0, 3, 4, 3, 0, 1, 0, 9, 10, 9, 12, 13, 12, 9, 10, 9 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

LINKS

Alois P. Heinz, Table of n, a(n) for n = 0..6560

FORMULA

a(n) = n - 2 * A005836(A289814(n) + 1) = A005836(A289813(n) + 1). - Andrey Zabolotskiy, Nov 11 2019

EXAMPLE

16 = 121_3, replacing 2 with 0 gives 101_3 = 10, so a(16) = 10.

MAPLE

a:= proc(n) local t, r, i; t, r:= n, 0;

      for i from 0 while t>0 do

        r:= r+3^i*(d-> `if`(d=2, 0, d))(irem(t, 3, 't'))

      od; r

    end:

seq(a(n), n=0..80);  # Alois P. Heinz, Jun 17 2014

MATHEMATICA

Array[FromDigits[IntegerDigits[#, 3] /. 2 -> 0, 3] &, 72, 0] (* Michael De Vlieger, Mar 17 2018 *)

PROG

(Python)

from sympy.ntheory.factor_ import digits

def a(n):return int("".join(map(str, digits(n, 3)[1:])).replace('2', '0'), 3) # Indranil Ghosh, Jun 10 2017

(PARI) a(n) = my(d=digits(n, 3)); fromdigits(apply(x->(if (x==2, 0, x)), d), 3); \\ Michel Marcus, Jun 10 2017

CROSSREFS

Cf. A004488, A117966, A005836, A289813, A289814.

Sequence in context: A260965 A278214 A072681 * A318840 A318830 A242803

Adjacent sequences:  A244039 A244040 A244041 * A244043 A244044 A244045

KEYWORD

nonn,base,look

AUTHOR

Joonas Pohjonen, Jun 17 2014

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 May 26 13:59 EDT 2022. Contains 354092 sequences. (Running on oeis4.)