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

A367608
Comma-number associated with A367606(n), but written in base 10, or -1 if A367606(n) = -1.
4
4, 7, 1, -1, 7, 2, 4, 7, 1, 4, 8, 1, 4, 8, 1, 5, 8, 2, 5, 7, 2, -1, 7, 2, 4, 7, 1, 4, 7, 1, 4, 7, 1, 4, 7, 1, 4, 7, 1, 4, 7, 1, 4, 7, 1, 4, 8, 1, 4, 8, 1, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 8, 2, 5, 7, 2, -1, 7, 2, 4, 7, 1, 4, 7, 1, 4, 7, 1, 4, 7, 1, 4, 7, 1, 4, 7, 1, 4, 7, 1, 4
OFFSET
1,1
COMMENTS
If n has a comma-successor m (say) in base 3, then a(n) is the comma-number linking n and m, and is equal to m-n; a(n) = -1 if n has no successor. See A367338 for definitions.
This is a base-3 analog of A367339.
LINKS
PROG
(Python)
from sympy.ntheory.factor_ import digits
def a(n):
b = n + 3*(n%3)
return next((b+y-n for y in [1, 2] if digits(b+y, 3)[1] == y), -1)
print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Dec 11 2023
KEYWORD
sign,base
AUTHOR
N. J. A. Sloane, Dec 11 2023.
STATUS
approved