Posted By

cobra90nj on 04/25/09


Tagged

project euletr sixteen


Versions (?)

Project Euler 16


 / Published in: PHP
 

  1. <?php
  2. //project euler 16
  3. //by cobra90nj
  4.  
  5. $pot = bcpow(2,1000);
  6. $loop = $sum = 0;
  7. $strpot = strlen($pot);
  8.  
  9. while ($loop < $strpot) {
  10. $sum += $pot{$loop};
  11. $loop++;
  12. }
  13.  
  14. echo $sum;

Report this snippet  

You need to login to post a comment.