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
Antti Karttunen, Table of n, a(n) for n = 0..8191
FORMULA
PROG
(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