cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A344853 a(n) = n minus (sum of digits of n in base 3).

Original entry on oeis.org

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

Views

Author

Thomas König, May 30 2021

Keywords

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

Examples

			a(20) = 20 - (2 + 0 + 2) = 16 because 20 is written as 202 in base 3.
		

Crossrefs

Cf. A011371 (in base 2), A066568 (in base 10).

Programs

  • Mathematica
    a[n_] := n - Plus @@ IntegerDigits[n, 3]; Array[a, 70, 0] (* Amiram Eldar, May 30 2021 *)
  • PARI
    a(n) = n - sumdigits(n, 3); \\ Michel Marcus, Jul 11 2021

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).