"; print "$B
"; while ($A != 0){ if (($A%2)==1){ $producto=$producto+$B; } $B=$B*2; $A=(int)($A/2); print "$A $B
"; } print "$producto
"; ?>