login
A286632
Base-3 digit sum of A254103: a(n) = A053735(A254103(n)).
5
0, 1, 2, 1, 3, 2, 4, 2, 4, 1, 3, 3, 5, 3, 5, 2, 5, 4, 6, 3, 4, 2, 4, 2, 6, 2, 4, 3, 6, 1, 3, 4, 6, 3, 5, 4, 7, 4, 6, 4, 5, 5, 7, 2, 5, 3, 5, 3, 7, 5, 7, 3, 5, 4, 6, 3, 7, 6, 8, 4, 4, 3, 5, 5, 7, 6, 8, 4, 6, 3, 5, 6, 8, 3, 5, 5, 7, 5, 7, 3, 6, 4, 6, 5, 8, 1, 3, 5, 6, 2, 4, 4, 6, 2, 4, 2, 8, 4, 6, 6, 8, 2, 4, 2, 6, 3, 5, 4, 7, 4, 6, 5, 8, 5, 7, 5, 9, 5, 7, 4, 5
OFFSET
0,3
COMMENTS
Reflecting the structure of A254103 also this sequence can be represented as a binary tree:
0
|
...................1...................
2 1
3......../ \........2 4......../ \........2
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
4 1 3 3 5 3 5 2
5 4 6 3 4 2 4 2 6 2 4 3 6 1 3 4
etc.
LINKS
FORMULA
a(n) = A053735(A254103(n)).
a(n) = A056239(A286633(n)).
For all n >= 0, a(A000079(n)) = n+1.
PROG
(Scheme) (define (A286632 n) (A053735 (A254103 n)))
(Python)
from sympy.ntheory.factor_ import digits
def a254103(n):
if n==0: return 0
if n%2==0: return 3*a254103(n/2) - 1
else: return floor((3*(1 + a254103((n - 1)/2)))/2)
def a(n): return sum(digits(a254103(n), 3)[1:]) # Indranil Ghosh, Jun 06 2017
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Jun 03 2017
STATUS
approved