|
|
A300222
|
|
In ternary (base-3) representation of n, replace 1's with 0's.
|
|
5
|
|
|
0, 0, 2, 0, 0, 2, 6, 6, 8, 0, 0, 2, 0, 0, 2, 6, 6, 8, 18, 18, 20, 18, 18, 20, 24, 24, 26, 0, 0, 2, 0, 0, 2, 6, 6, 8, 0, 0, 2, 0, 0, 2, 6, 6, 8, 18, 18, 20, 18, 18, 20, 24, 24, 26, 54, 54, 56, 54, 54, 56, 60, 60, 62, 54, 54, 56, 54, 54, 56, 60, 60, 62, 72, 72, 74, 72, 72, 74, 78, 78, 80, 0, 0, 2, 0, 0, 2, 6, 6, 8, 0, 0, 2
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
For n=46, which in base-3 (A007089) is 1201, replacing 1's with 0's gives 200, and as that is base-3 representation of 18 (= 2*(3^2) + 0*(3^1) + 0*(3^0)), a(46) = 18.
|
|
MATHEMATICA
|
Array[FromDigits[IntegerDigits[#, 3] /. 1 -> 0, 3] &, 93, 0] (* Michael De Vlieger, Mar 17 2018 *)
|
|
PROG
|
(PARI)
A244042(n) = fromdigits(apply(x->(x%2), digits(n, 3)), 3);
\\ Or directly as:
A300222(n) = fromdigits(apply(x->(if (1==x, 0, x)), digits(n, 3)), 3);
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|