Timeline for Sum of two squares
Current License: CC BY-SA 4.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 7, 2022 at 10:22 | comment | added | Jitse |
@solid.py Pajonk explained it nicely. In addition, the complete range can be covered by ~n*~n (== -(n+1) * -(n+1)) for the same byte count.
|
|
Feb 7, 2022 at 9:58 | comment | added | pajonk |
@solid.py as I get it, you don't need to check the whole range(n+1) for both summands, as one of them will always be <= n/2.
|
|
Feb 7, 2022 at 9:51 | comment | added | solid.py |
Nice answer! If I understand this packing trick of the two ranges, shouldn't range(n*n+1) be range((n+1)*(n+1)) or range((n+1)**2) to combine the two statements of range(n+1) ?
|
|
Feb 7, 2022 at 9:19 | history | edited | Jitse | CC BY-SA 4.0 |
added 3 characters in body
|
Feb 7, 2022 at 9:04 | history | edited | Jitse | CC BY-SA 4.0 |
added 4 characters in body
|
Feb 7, 2022 at 8:58 | history | answered | Jitse | CC BY-SA 4.0 |