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.

A353623 a(n) is the least k > 0 such that n and k*n can be added without carries in balanced ternary.

This page as a plain text file.
%I A353623 #11 May 01 2022 11:42:36
%S A353623 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,
%T A353623 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,
%U A353623 14,6,6,2,2,9,2,2,2,3,3,6,2,2,3,2,2,2,3,2
%N A353623 a(n) is the least k > 0 such that n and k*n can be added without carries in balanced ternary.
%C A353623 Two integers can be added without carries in balanced ternary if they have no equal nonzero digit at the same position.
%H A353623 Rémy Sigrist, <a href="/A353623/b353623.txt">Table of n, a(n) for n = 0..10000</a>
%H A353623 Wikipedia, <a href="https://en.wikipedia.org/wiki/Balanced_ternary">Balanced ternary</a>
%F A353623 a(n) = A353624(n) / n for any n > 0.
%F A353623 a(3*n) = a(n).
%e A353623 For n = 5:
%e A353623 - we consider the following cases:
%e A353623       k  bter(k*5)  carries?
%e A353623       -  ---------  --------
%e A353623       1        1TT  yes
%e A353623       2        101  yes
%e A353623       3       1TT0  yes
%e A353623       4       1T1T  yes
%e A353623       5       10T1  yes
%e A353623       6       1010  no
%e A353623 - so a(5) = 6.
%o A353623 (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) }
%o A353623 a(n) = for (k=1, oo, if (ok(n, n*k), return (k)))
%Y A353623 Cf. A059095, A261891 (binary analog), A353624.
%K A353623 nonn,base
%O A353623 0,2
%A A353623 _Rémy Sigrist_, Apr 30 2022