Select Page
Poker Forum
Over 1,291,000 Posts!
Poker ForumFTR Community

Project Euler

Results 1 to 14 of 14
  1. #1
    !Luck's Avatar
    Join Date
    Feb 2004
    Posts
    1,876
    Location
    Under a bridge

    Default Project Euler

    Anyone ever tried to solve these?
    http://projecteuler.net/problems
  2. #2
    MadMojoMonkey's Avatar
    Join Date
    Apr 2012
    Posts
    10,322
    Location
    St Louis, MO
    I only looked at the first few of these, but they look like exceedingly simple coding projects.

    I could imagine a few lines of code to solve any of the ones I read. I didn't see anything that was not immediately obvious how to solve it, and the only real limiting factor would be the power and memory of the computer used to find the solution.
  3. #3
    MadMojoMonkey's Avatar
    Join Date
    Apr 2012
    Posts
    10,322
    Location
    St Louis, MO
    If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

    Find the sum of all the multiples of 3 or 5 below 1000.
    In Excell, not even using a script:

    1) Fill column A with the numbers 1 to 999, with one number in each cell.
    * type 1 in cell A1, press enter.
    * type 2 in cell A2, press enter.
    * Click and drag to select those 2 cells, drag-expand the selection from the lower-right corner to fill the column A with numbers up to 999.

    2) isolate the numbers which are multiples of 3 or 5.
    * In cell B1, type the following:
    =IF(MOD(A1,3)=0,A1,IF(MOD(A1,5)=0,A1,0))
    * press enter.
    * select cell B1 and double-click on the lower-right corner of the cell. (this should fill the cells in column B exactly where you want it to and no more)

    3) Find the sum of the isolated numbers.
    * In any cell that is not already used, and not in column B, type the following:
    =SUM(B:B)

    The answer is 233,168
    Last edited by MadMojoMonkey; 01-16-2014 at 06:54 PM.
  4. #4
    Smart enough to solve them but not smart enough to click the about button.

    Solve this for me pls MMM, thanks.

    zN4h51m.jpg
    Last edited by Savy; 01-16-2014 at 07:09 PM.
  5. #5
    MadMojoMonkey's Avatar
    Join Date
    Apr 2012
    Posts
    10,322
    Location
    St Louis, MO
    Quote Originally Posted by ImSavy View Post
    Smart enough to solve them but not smart enough to click the about button.

    Solve this for me pls MMM, thanks.

    zN4h51m.jpg
    ... ummmm...

    what?
  6. #6
  7. #7
    I taught myself python this year, didn't expect to get that resolution over with so fast.

    total=0
    for i in range(x):
    if i % 3 == 0 or i % 5 == 0:
    total = total + i

    Same answer as MMM obv. And I have to concur they're all straight-forward codings. Maybe at the end they get harder.
  8. #8
    MadMojoMonkey's Avatar
    Join Date
    Apr 2012
    Posts
    10,322
    Location
    St Louis, MO
    Quote Originally Posted by ImSavy View Post
    Hmm. Interesting.

    Wasn't there a movie about something similar? Some kid solved a puzzle in a word-search, or something, and it was a CIA recruiting technique, or something? Mid-80's-ish?

    Anyone? No? Just me?
  9. #9
    !Luck's Avatar
    Join Date
    Feb 2004
    Posts
    1,876
    Location
    Under a bridge
    Once you get out of the 60s or so they start getting interesting. A simple one that I like is #67, since it requires a clever trick.
  10. #10
    MadMojoMonkey's Avatar
    Join Date
    Apr 2012
    Posts
    10,322
    Location
    St Louis, MO
    Quote Originally Posted by !Luck View Post
    Once you get out of the 60s or so they start getting interesting. A simple one that I like is #67, since it requires a clever trick.
    Start from the bottom, only keep the largest number in each slot, and work your way up?
  11. #11
    !Luck's Avatar
    Join Date
    Feb 2004
    Posts
    1,876
    Location
    Under a bridge
    yep.
  12. #12
    MadMojoMonkey's Avatar
    Join Date
    Apr 2012
    Posts
    10,322
    Location
    St Louis, MO
    #71
    Consider the fraction, n/d, where n and d are positive integers. If n<d and HCF(n,d)=1, it is called a reduced proper fraction.

    If we list the set of reduced proper fractions for d ≤ 8 in ascending order of size, we get:

    1/8, 1/7, 1/6, 1/5, 1/4, 2/7, 1/3, 3/8, 2/5, 3/7, 1/2, 4/7, 3/5, 5/8, 2/3, 5/7, 3/4, 4/5, 5/6, 6/7, 7/8

    It can be seen that 2/5 is the fraction immediately to the left of 3/7.

    By listing the set of reduced proper fractions for d ≤ 1,000,000 in ascending order of size, find the numerator of the fraction immediately to the left of 3/7.
    numerator = MAX(FLOOR([1:1e6]*3/7))
    denominator is the corresponding value.

    EDIT:
    X = 2/5;
    FOR N = 1:1e6
    Y = FLOOR(N*3/7)/N;
    IF Y > X
    X = Y;
    END
    END
    Last edited by MadMojoMonkey; 01-16-2014 at 09:23 PM.
  13. #13
    Quote Originally Posted by MadMojoMonkey View Post
    Hmm. Interesting.

    Wasn't there a movie about something similar? Some kid solved a puzzle in a word-search, or something, and it was a CIA recruiting technique, or something? Mid-80's-ish?

    Anyone? No? Just me?
    Mercury rising?
    Congratulations, you've won your dick's weight in sweets! Decode the message in the above post to find out how to claim your tic-tac
  14. #14
    Yeah I did some of these when learning Python. Fun mini projects that get harder as you progress.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •