Few code standards. Remove composer vendor folder
This commit is contained in:
15
solutions/other/sequence.php
Normal file
15
solutions/other/sequence.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
$num = 44;
|
||||
|
||||
for($i=0; $i<20; $i++)
|
||||
{
|
||||
$sum = 0;
|
||||
$number = (string)$num;
|
||||
for($c=0; $c < strlen($number);$c++)
|
||||
{
|
||||
$sum +=(int)$number[$c] * (int)$number[$c];
|
||||
}
|
||||
echo $sum . PHP_EOL;
|
||||
$num = $sum;
|
||||
}
|
Reference in New Issue
Block a user