OFFSET
1,2
COMMENTS
a(n) = n for all n coprime to 3.
LINKS
Liangzhou Chen, Table of n, a(n) for n = 1..10000
FORMULA
a(1) = 1, a(2) = 2, a(3n) = a(n) + 1, a(3n+1) = 3n+1, a(3n+2) = 3n+2.
EXAMPLE
The minimal DFA when n=6, giving the form of transition table:
+-------+-----------+
| | tr. func. |
| state +---+---+---+
| | 0 | 1 | 2 |
+-------+---+---+---+
|->*A | A | C | B | (mod 6 = 0)
+-------+---+---+---+
| B | A | C | B | (mod 6 = 2,4)
+-------+---+---+---+
| C | C | B | C | (mod 6 = 1,3,5)
+-------+---+---+---+
PROG
(PARI) a(n) = n / 3^valuation(n, 3) + valuation(n, 3)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Liangzhou Chen, Sep 10 2021
STATUS
approved