login
A344853
a(n) = n minus (sum of digits of n in base 3).
3
0, 0, 0, 2, 2, 2, 4, 4, 4, 8, 8, 8, 10, 10, 10, 12, 12, 12, 16, 16, 16, 18, 18, 18, 20, 20, 20, 26, 26, 26, 28, 28, 28, 30, 30, 30, 34, 34, 34, 36, 36, 36, 38, 38, 38, 42, 42, 42, 44, 44, 44, 46, 46, 46, 52, 52, 52, 54, 54, 54, 56, 56, 56, 60, 60, 60, 62, 62, 62
OFFSET
0,4
COMMENTS
All terms are even.
In all sequences of the form f(n) = n minus (sum of digits of n in base b), every term appears b times consecutively. Here b = 3, hence terms are entries of A346502 repeated 3 times. - Bernard Schott, Jul 21 2021
LINKS
FORMULA
a(n) = n - A053735(n).
a(n) = 2 * A054861(n).
a(n) = 2 * A004128(floor(n/3)).
a(3*n) = a(3*n+1) = a(3*n+2).
EXAMPLE
a(20) = 20 - (2 + 0 + 2) = 16 because 20 is written as 202 in base 3.
MATHEMATICA
a[n_] := n - Plus @@ IntegerDigits[n, 3]; Array[a, 70, 0] (* Amiram Eldar, May 30 2021 *)
PROG
(PARI) a(n) = n - sumdigits(n, 3); \\ Michel Marcus, Jul 11 2021
CROSSREFS
Cf. A011371 (in base 2), A066568 (in base 10).
Sequence in context: A180019 A274496 A112801 * A173862 A089873 A275433
KEYWORD
base,easy,nonn
AUTHOR
Thomas König, May 30 2021
STATUS
approved