OFFSET
0,2
COMMENTS
x<*>(3,2) means that the number obtained from digits of x are alternatively multiplicated by 3 and by 2 from right to left (taking carries into account).
a(n) = (...(1<*>(3,2))<*>(3,2))...<*>(3,2) (n recursive applications of the <*>(3,2) operator.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
V. Shevelev, Partition of multiplication
EXAMPLE
a(0) = 1 (no operation)
a(2) = 1*3
a(3) = (1*3)*3 = 9
a(4) = ((1*3)*3)*3 = 27
a(5) = (27)<*>(3,2) = [2*2,7*3] = 40 + 21 = 61
a(6) = (61)<*>(3,2) = [2*6,1*3] = 120+3 = 123
MAPLE
a:= proc(n) option remember; local i, m, r;
if n=0 then 1
else m, r:= a(n-1), 0;
for i from 0 while m>0 do
r:= r +10^i *irem(m, 10, 'm') *(3-irem(i, 2))
od; r
fi
end:
seq(a(n), n=0..40); # Alois P. Heinz, Jul 05 2013
MATHEMATICA
ShDM[n_, {a_, b_}] :=
Module[{ex = 0},
Plus @@
FoldList[(10^ex)*#2*{a, b}[[1 + Mod[ex++, 2]]] &, 0,
Reverse@IntegerDigits[n, 10]]];
NestList[ShDM[#, {3, 2}] &, 1, 25]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Vladimir Shevelev, Jul 01 2013
EXTENSIONS
Example, Mathematica program, extension and corrected definition by Olivier Gérard, Jul 05 2013
STATUS
approved