PythonProgrammingPuzzles icon indicating copy to clipboard operation
PythonProgrammingPuzzles copied to clipboard

Digit Dilemma

Open Ayaz-75 opened this issue 1 year ago • 0 comments

def sat(x: int):  
    """Find an integer x such that the sum of the digits of x squared equals x."""  
    return sum(int(d) for d in str(x ** 2)) == x 

Solvers, post your solutions in the comments using the following formatting:

<details><summary>Reveal solution</summary>

```python
def sol():
    return 9  # replace with your solution
```
</details>

Ayaz-75 avatar Feb 27 '25 07:02 Ayaz-75