Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ini_set("memory_limit",268435456);
- //ini_set("memory_limit","-1"); pour qu'ça affiche pas d'message d'erreur,
- // mais ça peut bouffer bcp d'mémoire,
- // donc c'est ssi tu sais c'que tu fais.
- // sinon, tu mets juste un truc supérieur à
- // 268435456 pour avoir plus de termes.
- ${"a"."0"} = [16];
- for ($i = 1; $i > 0; $i++) {
- for ($j = 0; $j < count(${"a".($i-1)}); $j++) {
- $t = count(${"a".($i-1)}) - 1;
- if ((${"a".($i-1)}[$j]/3-1/3) == floor(${"a".($i-1)}[$j]/3-1/3)) {
- $t++;
- ${"a".($i-1)}[$t] = ${"a".($i-1)}[$j]/3-1/3;
- }
- }
- for ($j = 0; $j < count(${"a".($i-1)}); $j++) {
- ${"a$i"}[$j] = 2*${"a".($i-1)}[$j];
- }
- sort(${"a".($i-1)});
- $t = 0;
- for ($j = 0; $j < count(${"a".($i-1)}); $j++) {
- if (${"a".($i-1)}[$j]+1 == ${"a".($i-1)}[$j+1]) {
- $t++;
- }
- }
- if ($i % 15 > 1) { print ", $t"; }
- elseif ($i % 15 == 0) { print ", $t,\n"; }
- elseif ($i % 15 == 1) { print "$t"; }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement