OFFSET
0,2
COMMENTS
Reflecting the structure of A254103 also this sequence can be represented as a binary tree:
1
|
...................2...................
3 2
6......../ \........4 9......../ \........3
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
12 2 6 6 18 8 18 4
24 12 27 6 12 3 9 4 36 4 12 6 36 2 6 12
etc.
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..8191
PROG
(Python)
from sympy.ntheory.factor_ import digits
from operator import mul
def a006047(n):
d=digits(n, 3)
return reduce(mul, [1 + d[i] for i in range(1, len(d))])
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 a006047(a254103(n)) # Indranil Ghosh, Jun 06 2017
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Jun 03 2017
STATUS
approved