summaryrefslogtreecommitdiff
path: root/052.py
diff options
context:
space:
mode:
authorReiner Herrmann <reiner@reiner-h.de>2014-08-31 20:21:45 +0200
committerReiner Herrmann <reiner@reiner-h.de>2014-08-31 20:35:09 +0200
commit95341b61b030c9e1290f3b326cb7ec584f543aea (patch)
tree852386fa04d32eb859bca11c0eff7b5ef9e50f00 /052.py
parent571164d977f91925c4c76a292f74f5f93d09ae23 (diff)
moved files to higher directory after split to new repositoryHEADtrunk
Diffstat (limited to '052.py')
-rw-r--r--052.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/052.py b/052.py
new file mode 100644
index 0000000..2419a72
--- /dev/null
+++ b/052.py
@@ -0,0 +1,22 @@
+
+def digits(n):
+ result = [0]*10
+ while n > 0:
+ digit = n % 10
+ n /= 10
+ result[digit] += 1
+ return result
+
+def check(n):
+ foo = [ digits(n*x) for x in range(1, 7) ]
+ return foo == foo[1:]+foo[:1] # all array entries are equal
+
+n = 1
+
+while True:
+ if check(n):
+ break
+ n += 1
+
+print n
+