Created
August 15, 2017 12:16
-
-
Save hellvesper/4ce435b11d1356b70e43c1e66e18d17b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by PhpStorm. | |
* User: vesper | |
* Date: 15/08/2017 | |
* Time: 14:21 | |
*/ | |
function progression($x = 4, $n = 0, $count = 3) { | |
$x = $x + (2 * (3 ** $n)); | |
echo "x = ".$x.PHP_EOL; | |
echo "n = ".$n.PHP_EOL; | |
$n++; | |
if (! ($count < 0)) { | |
echo "count: ".$count.PHP_EOL; | |
$count--; | |
return progression($x, $n, $count); | |
} else return 1; | |
} | |
progression(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment