diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-02-08 22:06:55 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-02-08 22:06:55 +0100 |
| commit | 31b43cf6d0d58812d30c0e2356f6458d06b1e52e (patch) | |
| tree | dcc70e28e92008db7934c72c531dffae98458359 /python/206-concealed_square.py | |
| parent | 8d23cd41eb9f4e0cf06715abe27c3999aa80aee9 (diff) | |
| download | project_euler-31b43cf6d0d58812d30c0e2356f6458d06b1e52e.tar.gz project_euler-31b43cf6d0d58812d30c0e2356f6458d06b1e52e.tar.bz2 project_euler-31b43cf6d0d58812d30c0e2356f6458d06b1e52e.zip | |
WIP: some exo in python
Diffstat (limited to 'python/206-concealed_square.py')
| -rw-r--r-- | python/206-concealed_square.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/python/206-concealed_square.py b/python/206-concealed_square.py new file mode 100644 index 0000000..e9d84ea --- /dev/null +++ b/python/206-concealed_square.py @@ -0,0 +1,18 @@ +# ### +#Concealed Square +# +# Problem 206 +# Find the unique positive integer whose square has the form 1_2_3_4_5_6_7_8_9_0, +# where each “_” is a single digit. +# ### + + +import math +from itertools import count + + +for n in count(int(math.sqrt(1020304050607080900)) - 1): + s = str(n * n) + if s[0] == "1" and s[2] == "2" and s[4] == "3" and s[6] == "4" and s[8] == "5" and s[10] == "6" and s[12] == "7" and s[14] == "8" and s[16] == "9" and s[18] == "0": + print(">>>", n) + break |
