Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 35

Math Help - Project Euler

  1. #16
    Senior Member Peritus's Avatar
    Joined
    Nov 2007
    Posts
    397
    I've done 77 problems so far (I've already told you I got addicted to it ) using c++.


    Follow Math Help Forum on Facebook and Google+

  2. #17
    Super Member angel.white's Avatar
    Joined
    Oct 2007
    Posts
    723
    Awards
    1
    Hey all, been a while, this is where I'm at now

    Mostly done with Ruby, some done in Java, some in C, one in Assembly (it's great for brute forcing!)

    Taking C++ and stats next semester, hopefully those will go well.

    (131/226)
    001, 002, 003, 004, 005, 006, 007, 008, 009, 010,
    011, 012, 013, 014, 015, 016, 017, 018, 019, 020,
    021, 022, 023, 024, 025, 026, 027, 028, 029, 030,
    031, 032, 033, 034, 035, 036, 037, 038, 039, 040,
    041, 042, 043, 044, 045, 046, 047, 048, 049, 050,
    051, 052, 053
    , 054, 055, 056, 057, 058, 059, 060,
    061, 062, 063
    , 064, 065, 066, 067, 068, 069, 070,
    071, 072, 073, 074, 075, 076, 077, 078, 079, 080,
    081, 082
    , 083, 084, 085, 086, 087, 088, 089, 090,
    091, 092, 093, 094, 095, 096, 097, 098, 099, 100,
    101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
    111, 112, 113, 114, 115, 116, 117, 118, 119, 120,
    121, 122, 123, 124, 125, 126, 127, 128, 129, 130,
    131, 132, 133, 134, 135, 136, 137, 138, 139, 140,
    141, 142, 143, 144, 145, 146, 147, 148, 149, 150,
    151, 152, 153, 154, 155, 156, 157, 158, 159, 160,
    161, 162, 163, 164, 165, 166, 167, 168, 169, 170,
    171, 172, 173, 174, 175, 176, 177, 178, 179, 180,
    181, 182, 183, 184, 185, 186, 187, 188, 189, 190,
    191
    , 192, 193, 194, 195, 196, 197, 198, 199, 200,
    201, 202, 203, 204, 205, 206, 207, 208, 209, 210
    211, 212, 213, 214, 215, 216, 217, 218, 219, 220
    221, 222, 223, 224, 225, 226
    Follow Math Help Forum on Facebook and Google+

  3. #18
    Senior Member Peritus's Avatar
    Joined
    Nov 2007
    Posts
    397
    What a coincidence, I also solved 131 problems. unfortunately I'm kinda stuck at this point.

    (131/226)
    001, 002, 003, 004, 005, 006, 007, 008, 009, 010,
    011, 012, 013, 014, 015, 016, 017, 018, 019, 020,
    021, 022, 023, 024, 025, 026, 027, 028, 029, 030,
    031, 032, 033, 034, 035, 036, 037, 038, 039, 040,
    041, 042, 043, 044, 045, 046, 047, 048, 049, 050,
    051, 052, 053, 054, 055, 056, 057, 058, 059, 060,
    061, 062, 063, 064, 065, 066, 067, 068, 069, 070,
    071, 072, 073, 074, 075, 076, 077, 078, 079, 080,
    081, 082, 083, 084, 085, 086, 087, 088, 089, 090,
    091, 092, 093, 094, 095, 096, 097, 098, 099, 100,
    101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
    111, 112, 113, 114, 115, 116, 117, 118, 119, 120,
    121, 122, 123, 124, 125, 126, 127, 128, 129, 130,
    131, 132, 133, 134, 135, 136, 137, 138, 139, 140,
    141, 142, 143, 144, 145, 146, 147, 148, 149, 150,
    151, 152, 153, 154, 155, 156, 157, 158, 159, 160,
    161, 162, 163, 164, 165, 166, 167, 168, 169, 170,

    171, 172, 173, 174, 175, 176, 177, 178, 179, 180,
    181, 182, 183, 184, 185, 186, 187, 188, 189, 190,
    191, 192, 193, 194, 195, 196, 197, 198, 199, 200,
    201, 202, 203, 204, 205, 206, 207, 208, 209, 210

    211, 212, 213, 214, 215, 216, 217, 218, 219, 220
    221, 222, 223, 224, 225, 226

    Follow Math Help Forum on Facebook and Google+

  4. #19
    Super Member angel.white's Avatar
    Joined
    Oct 2007
    Posts
    723
    Awards
    1
    Yeah, they definitely get harder :/
    The ones I find most rewarding are ones where I can brute force the low solutions, evaluate them and find a pattern to get the higher ones. But now that I've learned dynamic programming, I also enjoy ones that I can solve using this. Sometimes I get tired of working on a problem, brute force it with some long algorithm, then go to look at the solution, and seeing how it was done, wish I would have worked on it more :/

    Other times, though, I look at it and am glad I brute forced it ^_^

    I have a few problems that I'm saving for when I get into the C++ course, I also really enjoy the problems where I get to deal with graphs.
    Follow Math Help Forum on Facebook and Google+

  5. #20
    Newbie
    Joined
    Apr 2009
    Posts
    5

    The answer to problem 13

    I made an algorithm to solve problem 13 and this is my answer:
    3737623039

    If any one can tell me the right answer because when i type this number in the site it gives me a wrong answer ,and i don't know what's wrong with my program....
    Follow Math Help Forum on Facebook and Google+

  6. #21
    Super Member angel.white's Avatar
    Joined
    Oct 2007
    Posts
    723
    Awards
    1
    Quote Originally Posted by super.man View Post
    I made an algorithm to solve problem 13 and this is my answer:
    3737623039

    If any one can tell me the right answer because when i type this number in the site it gives me a wrong answer ,and i don't know what's wrong with my program....
    You're very close, but there are two digits in front of that, which you are missing. (ie, 3 and 9 on the end don't belong)

    The sum should be
    ??373762303908766373020487468329859717736598318926 72

    Where the question marks represent digits you need to find.
    Follow Math Help Forum on Facebook and Google+

  7. #22
    Newbie
    Joined
    Apr 2009
    Posts
    5

    Thank's alot

    Thank's alot i fixed my algorithm and it works perfectly
    Follow Math Help Forum on Facebook and Google+

  8. #23
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by super.man View Post
    I made an algorithm to solve problem 13 and this is my answer:
    3737623039

    If any one can tell me the right answer because when i type this number in the site it gives me a wrong answer ,and i don't know what's wrong with my program....
    Don't you think it is against the spirit of Project Euler for you to ask for any help at all with these.

    CB
    Follow Math Help Forum on Facebook and Google+

  9. #24
    Newbie
    Joined
    Apr 2009
    Posts
    5

    About asking for help

    To CB ,I don't think that it is wrong or it is against the spirit of Project Euler to ask for help because i am still a student and i am still learning
    Follow Math Help Forum on Facebook and Google+

  10. #25
    Member
    Joined
    Nov 2006
    From
    Florida
    Posts
    228
    Quote Originally Posted by super.man View Post
    To CB ,I don't think that it is wrong or it is against the spirit of Project Euler to ask for help because i am still a student and i am still learning
    I would have to agree. I think it would be against the spirit of Project Euler if one were to just ask for the answer from others without putting forward any effort themself.
    Follow Math Help Forum on Facebook and Google+

  11. #26
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by super.man View Post
    To CB ,I don't think that it is wrong or it is against the spirit of Project Euler to ask for help because i am still a student and i am still learning
    Arn't we all, and don't we learn a thing better by finding a solution ourselves??

    CB
    Follow Math Help Forum on Facebook and Google+

  12. #27
    Super Member angel.white's Avatar
    Joined
    Oct 2007
    Posts
    723
    Awards
    1
    Quote Originally Posted by CaptainBlack View Post
    Don't you think it is against the spirit of Project Euler for you to ask for any help at all with these.

    CB
    I don't think so. Everyone has help, whoever has taken a math course has learned something they can use in PE, I learned about La Grange multipliers in school the same week I tried problem 190, should I have put that knowledge out of my head because it came from an outside source and helped me with the Project Euler problem? Or is it intentionality that makes the difference? If we are lucky enough to learn the solution unintentionally it is valid, but if we intentionally learn it, it is not? (Then again, I intentionally took the course) The home page says you can research problems, Mathworld, Wikipedia, and a textbook surely contain many times more information than asking for aid.

    The home page says the problems are aimed at students, and adults whose background is not primarily mathematics, so one isn't expected to have Euler's capabilities in order to participate in Project Euler (though one could certainly argue that they deviate from this in the later problems).

    It says the motivation for starting and continuing PE is "to provide a platform for the inquiring mind to delve into unfamiliar areas and learn new concepts in a fun and recreational context" , and guidance is one of the most effective forms of learning (hence school). Also, it is not fun and recreational to try a problem fifty times with no correct answer and no feedback on where you are going wrong, this is essentially why I quit working on spoj.pl, while I made it all the way through javabat.com, learned a lot along the way, and was hungry for more.

    I think the spirit of PE is that each person get from it what that person wants from it, and for many of us, guidance makes a problem much less frustrating and much more interesting and rewarding.
    Quote Originally Posted by putnam120 View Post
    I would have to agree. I think it would be against the spirit of Project Euler if one were to just ask for the answer from others without putting forward any effort themself.
    Which is obviously not what he did.
    Follow Math Help Forum on Facebook and Google+

  13. #28
    Newbie
    Joined
    Apr 2009
    Posts
    5

    How can i handle large integers ?

    How can i handle large integers ?
    In problem 25 he want's the following:
    What is the first term in the Fibonacci sequence to contain 1000 digits?

    I thought of it and developed an algorithm to solve it using an arrays but it seems to be inefficient if any one can tell me how to handle large integers ...
    1000 digits !!!
    Follow Math Help Forum on Facebook and Google+

  14. #29
    Member
    Joined
    Nov 2006
    From
    Florida
    Posts
    228
    1) Use Java's BigInteger class and the toString() method.
    2) Write an efficient class to perform addition/multiplication of large numbers.

    I would look for an algorithm with logarithmic running time since F_n is about (1.6^n) for large n.
    Follow Math Help Forum on Facebook and Google+

  15. #30
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by super.man View Post
    How can i handle large integers ?
    In problem 25 he want's the following:
    What is the first term in the Fibonacci sequence to contain 1000 digits?

    I thought of it and developed an algorithm to solve it using an arrays but it seems to be inefficient if any one can tell me how to handle large integers ...
    1000 digits !!!
    Look at Binet's formula for the n-th Fibonacci number. It is the sum of two terms one of which growns with increasing n and the other goes to zero as n increases.

    Use the log_10 of just the increasing term to estimate the number of digits of F_n for large n.

    No need for extended prescision etc.

    CB
    Follow Math Help Forum on Facebook and Google+

Page 2 of 3 FirstFirst 123 LastLast

Similar Math Help Forum Discussions

  1. GCD Project
    Posted in the Number Theory Forum
    Replies: 1
    Last Post: February 18th 2011, 03:07 AM
  2. Euler path and Euler circuit problem
    Posted in the Discrete Math Forum
    Replies: 1
    Last Post: May 19th 2010, 09:18 PM
  3. Replies: 0
    Last Post: February 20th 2010, 09:26 AM
  4. Replies: 0
    Last Post: September 17th 2009, 07:44 PM
  5. Project HELP!
    Posted in the Calculus Forum
    Replies: 1
    Last Post: October 24th 2007, 06:11 AM

Search Tags


/mathhelpforum @mathhelpforum