Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $number_of_elements = 3;
- for($i = $lower_bound ; $i <= $upper_bound-$number_of_elements+1 ; $i++) {
- for ($j = $i + 1 ; $j <= $upper_bound-$number_of_elements+2 ; $j++){
- for ($k = $j + 1 ; $k <= $upper_bound-$number_of_elements+3 ; $k++){
- # print $i.",".$j.",".$k,"====",special_sum($i+$j+$k),"\n";
- if (special_sum($i+$j+$k) == $sum_of_digits){
- push @result, $i.",".$j.",".$k;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment