summaryrefslogtreecommitdiffstats
path: root/145-broken.lua
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2009-05-15 10:05:49 -0500
committerJesse Luehrs <doy@tozt.net>2009-05-15 10:05:49 -0500
commitdb1d685414ac9257082803be8af9b27a088d8938 (patch)
tree92bba99d4ada3fab21ef64cea35181a75986e2bb /145-broken.lua
parent5afab29454b75fa55cc54fc32fa39b20aea75134 (diff)
downloadprojecteuler-db1d685414ac9257082803be8af9b27a088d8938.tar.gz
projecteuler-db1d685414ac9257082803be8af9b27a088d8938.zip
mark these old ones as non-working
Diffstat (limited to '145-broken.lua')
-rw-r--r--145-broken.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/145-broken.lua b/145-broken.lua
new file mode 100644
index 0000000..1713881
--- /dev/null
+++ b/145-broken.lua
@@ -0,0 +1,12 @@
+-- this will take ~6h to run... need efficiency!
+function reversible(n)
+ local revn = n:reverse()
+ local str = tostring(n + revn)
+ return not str:match("[02468]")
+end
+
+local sum = 0
+for i = 1, 999999999 do
+ if i % 10 ~= 0 and reversible(tostring(i)) then sum = sum + 1 end
+end
+print(sum)