Question: Translate Mathematica-Expression to Maple-Code

I have tried to translate the Mathematica-Code of OEIS (A219954):

A219954list[nmax_]:=Accumulate[Table[If[n==1, 0, 3^DigitCount[n-1, 2, 1]-If[IntegerQ[Log2[n]], n/2, 0]], {n, nmax}]]; A219954list[100]

with MmaTranslator. In the translator occurs an error message with the IF-Statement ...

I will be happy to have this in Maple. I am interested in the digitCount in the above Code.

Sequence is:

 

0, 2, 5, 12, 15, 24, 33, 56, 59, 68, 77, 104, 113, 140, 167, 240, 243, 252, 261, 288, 297, 324, 351, 432, 441, 468, 495, 576, 603, 684, 765, 992, 995,

Thanks for help :)

Please Wait...