A367619 a(n) is the most remote positive ancestor of n in the comma-child graph in base 3.
1, 2, 3, 3, 1, 1, 7, 1, 2, 2, 7, 1, 1, 2, 1, 1, 1, 1, 7, 1, 1, 2, 1, 7, 1, 7, 1, 1, 1, 1, 1, 1, 7, 7, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 7, 7, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 7, 1, 7, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 7, 1, 7, 1, 1, 1, 1, 1, 1, 7
Offset: 1
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..2200
- 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
Programs
-
Python
from functools import cache from sympy.ntheory.factor_ import digits def comma_parent(n, base=3): # A367618(n) y = digits(n, base)[1] x = (n-y)%base k = n - y - base*x return k if k > 0 else -1 @cache def a(n): cp = comma_parent(n) if cp <= 0: return n return a(cp) print([a(n) for n in range(1, 88)])
Comments