OFFSET
1,4
COMMENTS
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
Eric Angelini, Michael S. Branicky, Giovanni Resta, N. J. A. Sloane, and David W. Wilson, The Comma Sequence: A Simple Sequence With Bizarre Properties, arXiv:2401.14346, Youtube
FORMULA
a(n) = n - y - b*((n-y) mod b) where b is the base and y is the first digit of a(n); it is said to exist if a(n) > 0, else undefined (here, -1).
PROG
(Python)
from functools import cache
from sympy.ntheory.factor_ import digits
def a(n, base=3):
y = digits(n, base)[1]
x = (n-y)%base
k = n - y - base*x
return k if k > 0 else -1
print([a(n) for n in range(1, 88)])
CROSSREFS
KEYWORD
sign,base
AUTHOR
Michael S. Branicky and N. J. A. Sloane, Dec 20 2023
STATUS
approved