OFFSET
1,1
COMMENTS
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
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
CROSSREFS
KEYWORD
sign,base
AUTHOR
N. J. A. Sloane, Dec 11 2023.
STATUS
approved