project_euler.problem_125.sol1 ============================== .. py:module:: project_euler.problem_125.sol1 .. autoapi-nested-parse:: Problem 125: https://projecteuler.net/problem=125 The palindromic number 595 is interesting because it can be written as the sum of consecutive squares: 6^2 + 7^2 + 8^2 + 9^2 + 10^2 + 11^2 + 12^2. There are exactly eleven palindromes below one-thousand that can be written as consecutive square sums, and the sum of these palindromes is 4164. Note that 1 = 0^2 + 1^2 has not been included as this problem is concerned with the squares of positive integers. Find the sum of all the numbers less than 10^8 that are both palindromic and can be written as the sum of consecutive squares. Attributes ---------- .. autoapisummary:: project_euler.problem_125.sol1.LIMIT Functions --------- .. autoapisummary:: project_euler.problem_125.sol1.is_palindrome project_euler.problem_125.sol1.solution Module Contents --------------- .. py:function:: is_palindrome(n: int) -> bool Check if an integer is palindromic. >>> is_palindrome(12521) True >>> is_palindrome(12522) False >>> is_palindrome(12210) False .. py:function:: solution() -> int Returns the sum of all numbers less than 1e8 that are both palindromic and can be written as the sum of consecutive squares. .. py:data:: LIMIT :value: 100000000