PyPE solution to PE problem 40

Registered by Scott Armitage

PyPE solution to PE problem 40

Blueprint information

Status:
Complete
Approver:
None
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
Approved
Series goal:
None
Implementation:
Implemented
Milestone target:
None
Started by
Scott Armitage
Completed by
Scott Armitage

Related branches

Sprints

Whiteboard

    ProjectEuler.net problem 40
    ===========================

    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 n^(th) 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

    Solution
    --------

    Froget the "factional" part; just say that d_n is looking for the nth digit
    in the series concat([0,1,2,...]) (starting at d_0 = 0). I feel dirty for
    it, but Python is so good at strings that I was able to easily brute-force
    this one.

    There are the startings of a numeric solution for n < 10 and n < 100; it
    may be possible to generalize these formula for any n.

    Answer
    ------

    210

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.