login
A090639
a(0) = 0; a(2n) = 3*a(n), a(2n+1) = a(n) + 1.
2
0, 1, 3, 2, 9, 4, 6, 3, 27, 10, 12, 5, 18, 7, 9, 4, 81, 28, 30, 11, 36, 13, 15, 6, 54, 19, 21, 8, 27, 10, 12, 5, 243, 82, 84, 29, 90, 31, 33, 12, 108, 37, 39, 14, 45, 16, 18, 7, 162, 55, 57, 20, 63, 22, 24, 9, 81, 28, 30, 11, 36, 13, 15, 6, 729, 244, 246, 83, 252, 85, 87, 30, 270, 91
OFFSET
0,3
LINKS
N. J. A. Sloane and J. A. Sellers, On non-squashing partitions, Discrete Math., 294 (2005), 259-274.
MAPLE
S := 3; f := proc(n) global S; option remember; if n=0 then RETURN(0); fi; if n mod 2 = 0 then RETURN(S*f(n/2)); else f((n-1)/2)+1; fi; end;
MATHEMATICA
a[0] = 0; a[n_] := a[n] = If[EvenQ[n], 3*a[n/2], a[(n - 1)/2] + 1];
Table[a[n], {n, 0, 73}] (* Jean-François Alcover, Jan 18 2018 *)
CROSSREFS
Sequence in context: A104005 A224578 A134562 * A294370 A325984 A178774
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Dec 14 2003
STATUS
approved