login
A367356
Length of base-3 Commas sequence when started at n.
9
17, 5, 2, 1, 16, 164, 490, 163, 4, 3, 489, 15, 14, 2, 162, 161, 13, 1472, 488, 1471, 160, 1, 159, 487, 12, 486, 1470, 1469, 11, 158, 157, 1468, 485, 484, 156, 10, 9, 483, 1467, 1466, 8, 155, 154, 1465, 482, 481, 153, 7, 6, 480, 1464, 1463, 5, 41, 152, 40, 1462, 479, 1461, 151, 4, 150, 478, 39, 477, 3, 1460, 2, 38, 149, 37, 1459, 476, 1458, 148, 1, 147, 475, 36, 474, 1457, 1456, 35, 146, 145, 1455, 473, 472, 144, 34, 33, 471, 1454, 1453, 32, 143, 142, 1452, 470, 469
OFFSET
1,1
COMMENTS
a(n) = 1 for n = 4, 22, 76, ... (the numbers 222...2211 in ternary)
We now know that a(n) is finite for all n.
LINKS
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
EXAMPLE
For a(1) = 17, see A367355, which has 17 terms.
PROG
(Python)
from itertools import islice
from sympy.ntheory.factor_ import digits
def a(n, b=3): # generator of terms
an, y, c = n, 1, 0
while y < b:
an, y, c = an + b*(an%b), 1, c+1
while y < b:
if str(digits(an+y, b)[1]) == str(y):
an += y
break
y += 1
return c
print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Nov 18 2023
CROSSREFS
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Nov 18 2023
STATUS
approved