mirror of
https://github.com/jlengrand/project_euler.git
synced 2026-03-10 08:41:20 +00:00
Solves problem 56
Didn't expect it to be so simple. I'd like to find the nice way to sum all numbers of an integer
This commit is contained in:
21
e_40.py
Normal file
21
e_40.py
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env python
|
||||
"""
|
||||
##---
|
||||
# Julien Lengrand-Lambert
|
||||
#Created on : 16 - 10 - 2012
|
||||
#
|
||||
# DESCRIPTION : Solves problem 40 of Project Euler
|
||||
An irrational decimal fraction is created by concatenating the positive integers:
|
||||
|
||||
0.123456789101112131415161718192021...
|
||||
|
||||
It can be seen that the 12th digit of the fractional part is 1.
|
||||
|
||||
If d_n represents the nth digit of the fractional part, find the value of the following expression.
|
||||
d_1 d_10 d_100 d_1000 d_10000 d_100000 d_1000000
|
||||
|
||||
##---
|
||||
"""
|
||||
if __name__ == '__main__':
|
||||
print 1
|
||||
#print "Answer : %d " % (last_ten())
|
||||
Reference in New Issue
Block a user