Project Euler: math + programming = fun puzzles! | INFJ Forum

Project Euler: math + programming = fun puzzles!

Discussion in 'Science and Technology' started by corvidae, Jul 24, 2009.

Share This Page

Watchers:
This thread is being watched by 1 user.
More threads by corvidae
  1. corvidae

    corvidae ohai internets
    Donor

    Joined:
    Dec 23, 2008
    Threads:
    60
    Messages:
    806
    Likes Received:
    54
    Trophy Points:
    0
    MBTI:
    INTJ
    Enneagram:
    ?
    Although I think many INFJs will beg to differ with my title, I find the programming puzzles on projecteuler.net to be addicting. The interesting thing is that although it's possible to solve most puzzles by brute force (i.e., plug in every single number until one works), the philosophy is that you ought to create a program that will calculate in under a minute, and often, under a second.

    For example, one problem was to find the last 10 digits of the expression:
    Code:
    1^1 + 2^2 + 3 ^3 + 4^4 ... + 999^999 + 1000^1000
    You could theoretically just add all 1000 terms and find the last 10 digits then, but most programming languages do not calculate numbers anywhere near the size of 1000^1000. And it's more fun to be creative =)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. NaeturVindur

    NaeturVindur Cuddlemaster
    Retired Staff

    Joined:
    Nov 17, 2008
    Threads:
    86
    Messages:
    3,686
    Likes Received:
    265
    Trophy Points:
    641
    MBTI:
    iNfj
    Enneagram:
    9w1
    write a program to find the pattern in the last 10 digits, then sequence it till the numbers would be 1000 (its 2 am, you get what I mean).
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Phyllotaxis

    Joined:
    Jul 21, 2009
    Threads:
    1
    Messages:
    36
    Likes Received:
    2
    Trophy Points:
    0
    MBTI:
    WGAS
    I have been member for a few years. How many have you completed?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. OP
    corvidae

    corvidae ohai internets
    Donor

    Joined:
    Dec 23, 2008
    Threads:
    60
    Messages:
    806
    Likes Received:
    54
    Trophy Points:
    0
    MBTI:
    INTJ
    Enneagram:
    ?
    Only 19, I'm still new to using Scheme.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Phyllotaxis

    Joined:
    Jul 21, 2009
    Threads:
    1
    Messages:
    36
    Likes Received:
    2
    Trophy Points:
    0
    MBTI:
    WGAS
    I have never liked Lisp. I started doing mine in C++ then decided to switch to Perl to do the problems because it was a lot easier to add arbitrary numbers to it and also didn't have to mess with type conversions.

    I'm not that much further. I've completed 25 of them. I haven't worked on them in quite some time. I'm sure I would have many more if I were determined. Heh.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. OP
    corvidae

    corvidae ohai internets
    Donor

    Joined:
    Dec 23, 2008
    Threads:
    60
    Messages:
    806
    Likes Received:
    54
    Trophy Points:
    0
    MBTI:
    INTJ
    Enneagram:
    ?
    perl sounds like exactly the kind of language that would work for Project Euler. It's messy, it's hackish, but it works.

    I wonder what poor guy is doing everything in VB.NET...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. Phyllotaxis

    Joined:
    Jul 21, 2009
    Threads:
    1
    Messages:
    36
    Likes Received:
    2
    Trophy Points:
    0
    MBTI:
    WGAS
    I'm very much a proponent of Perl. I think it is by far the best language for a first language. Not really that useful for making fancy stuff but when you just need to do stuff like complex math problems or manipulate text, it's perfect.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #7 Phyllotaxis, Jul 26, 2009
    Last edited: Jul 27, 2009
  8. NaeturVindur

    NaeturVindur Cuddlemaster
    Retired Staff

    Joined:
    Nov 17, 2008
    Threads:
    86
    Messages:
    3,686
    Likes Received:
    265
    Trophy Points:
    641
    MBTI:
    iNfj
    Enneagram:
    9w1
    If I were to try any, I probably would be that poor guy, seeing as I only know QBASIC and Visual BASIC. But I'm not a programmer, and I don't aspire to be one, so I'm not too worried about it.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. Phyllotaxis

    Joined:
    Jul 21, 2009
    Threads:
    1
    Messages:
    36
    Likes Received:
    2
    Trophy Points:
    0
    MBTI:
    WGAS
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. OP
    corvidae

    corvidae ohai internets
    Donor

    Joined:
    Dec 23, 2008
    Threads:
    60
    Messages:
    806
    Likes Received:
    54
    Trophy Points:
    0
    MBTI:
    INTJ
    Enneagram:
    ?
    Don't worry about free books, that's what bittorrent is for ;D
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. Phyllotaxis

    Joined:
    Jul 21, 2009
    Threads:
    1
    Messages:
    36
    Likes Received:
    2
    Trophy Points:
    0
    MBTI:
    WGAS
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. Phyllotaxis

    Joined:
    Jul 21, 2009
    Threads:
    1
    Messages:
    36
    Likes Received:
    2
    Trophy Points:
    0
    MBTI:
    WGAS
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #12 Phyllotaxis, Aug 6, 2009
    Last edited: Aug 6, 2009
Loading...

Share This Page