[go: up one dir, main page]

login
Search: a367617 -id:a367617
     Sort: relevance | references | number | modified | created      Format: long | short | data
a(n) is the most remote positive ancestor of n in the comma-child graph in base 3.
+10
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,2
COMMENTS
Analogous to A367617, but the calculations are done in base 3.
See A367338 for definitions of comma-child.
The sequence consists entirely of terms in {1, 2, 3, 7}. In particular, two terms, a(3) = a(4) = 3; five terms, a(2,9,10,14,22) = 2; and 490 terms are 7, ending with a(2182). All other terms a(k) are 1, since a(2183..2190) = 1 and 1 <= p(n) - n <= b^2 - 1 (= 8 for base b = 3).
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
FORMULA
a(n) is defined as n if A367618(n) = -1, else A367618(A367618(n)).
PROG
(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)])
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved
a(n) = smallest k such that the commas sequence (cf. A121805) with initial term k contains n.
+10
2
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 1, 13, 14, 15, 16, 17, 18, 19, 20, 21, 20, 10, 2, 25, 26, 27, 28, 29, 30, 31, 32, 30, 21, 1, 3, 37, 38, 39, 40, 41, 42, 43, 40, 31, 20, 13, 4, 49, 50, 51, 52, 53, 54, 50, 41, 32, 10, 14, 60, 5, 62, 63, 64, 65, 60, 51, 42, 30, 70, 2, 15, 6, 74, 75
OFFSET
1,2
COMMENTS
Every k >= 1 appears in this sequence exactly A330128(k) times. So there are 2137453 1's, 194697747222394 2's, 2 3's, 209534289952018960 6's, and so on.
a(n) is the most remote ancestor of n in the comma-successor graph.
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
All terms n in A121805 have a(n) = 1, all n in A139284 have a(n) = 2, all n in A366492 have a(n) = 4, and so on.
PROG
(Python)
def comma_predecessor(n): # A367614(n)
y = int(str(n)[0])
x = (n-y)%10
k = n - y - 10*x
kk = k + 10*x + y-1
return k if k > 0 and int(str(kk)[0]) != y-1 else -1
def a(n):
an = n
while (cp:=comma_predecessor(an)) > 0: an = cp
return an
print([a(n) for n in range(1, 76)]) # Michael S. Branicky, Dec 18 2023
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Dec 05 2023
STATUS
approved

Search completed in 0.007 seconds