login
Comma-number associated with A367606(n), but written in base 10, or -1 if A367606(n) = -1.
4

%I #17 Jul 09 2025 05:03:25

%S 4,7,1,-1,7,2,4,7,1,4,8,1,4,8,1,5,8,2,5,7,2,-1,7,2,4,7,1,4,7,1,4,7,1,

%T 4,7,1,4,7,1,4,7,1,4,7,1,4,8,1,4,8,1,5,8,2,5,8,2,5,8,2,5,8,2,5,8,2,5,

%U 8,2,5,8,2,5,7,2,-1,7,2,4,7,1,4,7,1,4,7,1,4,7,1,4,7,1,4,7,1,4,7,1,4

%N Comma-number associated with A367606(n), but written in base 10, or -1 if A367606(n) = -1.

%C If n has a comma-successor m (say) in base 3, then a(n) is the comma-number linking n and m, and is equal to m-n; a(n) = -1 if n has no successor. See A367338 for definitions.

%C This is a base-3 analog of A367339.

%H Michael S. Branicky, <a href="/A367608/b367608.txt">Table of n, a(n) for n = 1..10000</a>

%o (Python)

%o from sympy.ntheory.factor_ import digits

%o def a(n):

%o b = n + 3*(n%3)

%o return next((b+y-n for y in [1, 2] if digits(b+y, 3)[1] == y), -1)

%o print([a(n) for n in range(1, 101)]) # _Michael S. Branicky_, Dec 11 2023

%Y Cf. A121085, A367339, A367355, A367356, A367606-A367609.

%K sign,base

%O 1,1

%A _N. J. A. Sloane_, Dec 11 2023