login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A353623
a(n) is the least k > 0 such that n and k*n can be added without carries in balanced ternary.
3
1, 2, 3, 2, 2, 6, 3, 3, 2, 2, 2, 5, 2, 2, 6, 6, 5, 3, 3, 3, 3, 3, 6, 2, 2, 3, 2, 2, 2, 3, 2, 2, 9, 5, 12, 2, 2, 2, 12, 2, 2, 6, 6, 12, 11, 6, 6, 14, 5, 9, 8, 3, 3, 3, 3, 3, 3, 3, 9, 11, 3, 3, 3, 3, 3, 14, 6, 6, 2, 2, 9, 2, 2, 2, 3, 3, 6, 2, 2, 3, 2, 2, 2, 3, 2
OFFSET
0,2
COMMENTS
Two integers can be added without carries in balanced ternary if they have no equal nonzero digit at the same position.
LINKS
FORMULA
a(n) = A353624(n) / n for any n > 0.
a(3*n) = a(n).
EXAMPLE
For n = 5:
- we consider the following cases:
k bter(k*5) carries?
- --------- --------
1 1TT yes
2 101 yes
3 1TT0 yes
4 1T1T yes
5 10T1 yes
6 1010 no
- so a(5) = 6.
PROG
(PARI) ok(u, v) = { while (u && v, my (uu=[0, +1, -1][1+u%3], vv=[0, +1, -1][1+v%3]); if (abs(uu+vv)>1, return (0)); u=(u-uu)/3; v=(v-vv)/3); return (1) }
a(n) = for (k=1, oo, if (ok(n, n*k), return (k)))
CROSSREFS
Cf. A059095, A261891 (binary analog), A353624.
Sequence in context: A214320 A119809 A007653 * A272181 A154179 A300862
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Apr 30 2022
STATUS
approved