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

A353624
a(0) = 0, and for n > 0, a(n) is the least multiple of n that can be added to n without carries in balanced ternary.
3
0, 2, 6, 6, 8, 30, 18, 21, 16, 18, 20, 55, 24, 26, 84, 90, 80, 51, 54, 57, 60, 63, 132, 46, 48, 75, 52, 54, 56, 87, 60, 62, 288, 165, 408, 70, 72, 74, 456, 78, 80, 246, 252, 516, 484, 270, 276, 658, 240, 441, 400, 153, 156, 159, 162, 165, 168, 171, 522, 649
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) = n * A353623(n).
a(3*n) = 3*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*5 = 30.
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 (n*k)))
CROSSREFS
Cf. A059095, A261892 (binary analog), A353623.
Sequence in context: A230292 A082911 A005869 * A377998 A372610 A021978
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Apr 30 2022
STATUS
approved