Posts

Showing posts from October, 2026

Robbie Hatley’s Solutions, in Perl, for The Weekly Challenge #393 (“Pythagoras Multiplied” and “Prime Step”)

Image
For those not familiar with "The Weekly Challenge", it is a weekly programming puzzle with two parts, with a new pair of tasks each Monday. You can find it here: The Weekly Challenge The Weekly Challenge for the week of 2026-09-28 through 2026-10-04 is #393. The tasks for challenge #393 are as follows: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Task 393-1: Pythagoras Multiplied Submitted by: Ulrich Rieke You are given a positive integer n. Find the number of all positive integer triplets (a, b, c) so that a^2 + b^2 = c^2 and a, b and c are integers <= n. I'll use a pair of nested ranged foreach loops to check all possible (c,a) pairs to see which (if any) need b values which are positive integers in order for "$a*$a + $b*$b == $c*$c" to be true. Robbie Hatley's Perl Solution to The Weekly Challenge 393-1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Task 393-2: Prime Step Submitted b...