OFFSET
0,2
COMMENTS
Terms of A344853 without repetition.
All terms are even.
A new largest gap between 2 consecutive terms is obtained between a(3^m-1) and a(3^m), m >= 0 (see formula).
FORMULA
EXAMPLE
a(8) = 24 - (sum of digits of 24 in base 3); 24_10 = 220_3 and 2+2+0 = 4, so a(8) = 24-4 = 20.
MATHEMATICA
a[n_] := 3*n - Plus @@ IntegerDigits[3*n, 3]; Array[a, 100, 0] (* Amiram Eldar, Jul 22 2021 *)
PROG
(PARI) a(n) = 3*n - sumdigits(n, 3); \\ Kevin Ryde, Jul 21 2021
(Python)
from sympy.ntheory.digits import digits
def a(n): return 3*n - sum(digits(3*n, 3)[1:])
print([a(n) for n in range(60)]) # Michael S. Branicky, Jul 28 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Bernard Schott, Jul 21 2021
STATUS
approved