#!/usr/bin/php = MAX) { break; } for($middle = 0; $middle < $primeCount; $middle++) { $cube = $fourth + $primes[$middle] ** 3; if ($cube >= MAX) { break; } for($inner = 0; $inner < $primeCount; $inner++) { $sum = $cube + $primes[$inner] ** 2; if ($sum >= MAX) { break; } $sums[] = $sum; } } } echo "Found ".count(array_unique($sums))." numbers\n";