Weekly Challenge 393
Each week Mohammad S. Anwar sends out The Weekly Challenge , a chance for all of us to come up with solutions to two weekly tasks. My solutions are written in Python first, and then converted to Perl. Unless otherwise stated, Copilot (and other AI tools) have NOT been used to generate the solution. It's a great way for us all to practice some coding.
Challenge , My solutions
Task 1: Pythagoras Multiplied
You are given a positive integer n .
Find the number of all positive integer triplets ( a , b , c ) so that a² + b² = c² and a , b and c are integers <= n.
My solution
Since $a and $b are special variables in Perl, I call the values i , j and k .…