login
Comma-number associated with A367607(n), and written in base 3, or -1 if A367607(n) = -1.
5

%I #13 Feb 07 2024 13:21:43

%S 11,21,1,-1,21,2,11,21,1,11,22,1,11,22,1,12,22,2,12,21,2,-1,21,2,11,

%T 21,1,11,21,1,11,21,1,11,21,1,11,21,1,11,21,1,11,21,1,11,22,1,11,22,1,

%U 12,22,2,12,22,2,12,22,2,12,22,2,12,22,2,12,22,2,12,22,2,12,21,2,-1,21,2,11,21,1,11,21,1,11,21,1,11,21,1,11,21,1,11,21,1,11,21,1,11

%N Comma-number associated with A367607(n), and written in base 3, or -1 if A367607(n) = -1.

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

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

%H Eric Angelini, Michael S. Branicky, Giovanni Resta, N. J. A. Sloane, and David W. Wilson, The Comma Sequence: A Simple Sequence With Bizarre Properties, <a href="http://arxiv.org/abs/2401.14346">arXiv:2401.14346</a>, <a href="https://www.youtube.com/watch?v=_EHAdf6izPI">Youtube</a>

%o (Python)

%o from sympy.ntheory.factor_ import digits

%o def a(n):

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

%o return next((int("".join(map(str, digits(b+y-n, 3)[1:]))) 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-A367608.

%K sign,base

%O 1,1

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