Page 1 of 3 123 LastLast
Results 1 to 15 of 35

Math Help - Project Euler

  1. #1
    Super Member angel.white's Avatar
    Joined
    Oct 2007
    Posts
    723
    Awards
    1

    Project Euler

    Just curious if anyone else on here does Project Euler.

    I started yesterday, solved 1, 5, 6, 7

    Project Euler
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Senior Member Peritus's Avatar
    Joined
    Nov 2007
    Posts
    397
    This is just what I've been looking for, it will help me improve my programming and algorithmic skills.

    (I have some decent skills in Matlab & C, and now I've started to learn C++).
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Eater of Worlds
    galactus's Avatar
    Joined
    Jul 2006
    From
    Chaneysville, PA
    Posts
    3,001
    Thanks
    1
    I seen #25 was a good one.

    I got that one right off. Have to look again later. Thanks. Cool site.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by angel.white View Post
    Just curious if anyone else on here does Project Euler.

    I started yesterday, solved 1, 5, 6, 7

    Project Euler
    1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 21, 24, 25, 26, 101

    Don't do them unless I'm bored.

    RonL
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Super Member angel.white's Avatar
    Joined
    Oct 2007
    Posts
    723
    Awards
    1
    Quote Originally Posted by Peritus View Post
    This is just what I've been looking for, it will help me improve my programming and algorithmic skills.

    (I have some decent skills in Matlab & C, and now I've started to learn C++).
    Nice. I'm using C, I learn well by doing small projects like this, so I'm hoping to use this to learn C better, since I'm a bit behind in my data structures course right now (but catching up quickly)!
    Quote Originally Posted by CaptainBlack View Post
    1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 21, 24, 25, 26, 101

    Don't do them unless I'm bored.

    RonL
    Did you use programming or just straight math? I've used math on 3 of them, but like #7 (find the 10001st prime number) seems like you would require programming to solve. (if there is a way to do it with just math, then you should give me a clue, I'd love to learn that)
    Quote Originally Posted by galactus View Post
    I seen #25 was a good one.

    I got that one right off. Have to look again later. Thanks. Cool site.
    Wow, you're much better than me :/ I can't even seem to get a formula to find a given Fibonacci number. I think I'm going to have to do this one with programming.

    edit: Actually, in retrospect, I have no idea where to begin, I don't have a datatype large enough to hold 1000 digits. Maybe I could find a way to treat numbers as strings. It's going to take some thinking.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Eater of Worlds
    galactus's Avatar
    Joined
    Jul 2006
    From
    Chaneysville, PA
    Posts
    3,001
    Thanks
    1
    For #25, use Binet's formula. That is the formula that gives the nth Fibonacci number. Then use logs. That is how I done it.

    nlog(\frac{\sqrt{5}+1}{2})-log(\sqrt{5})

    With some trial and error or solving we get n=4782.

    Which gives us 999.029410673

    We round up, so the first Fibonacci number with 1000 digits is the 4782nd one.

    Then we have 10^{.029410673}=1.07

    This tells us the first digit of this huge number is 1.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Super Member angel.white's Avatar
    Joined
    Oct 2007
    Posts
    723
    Awards
    1
    Quote Originally Posted by galactus View Post
    For #25, use Binet's formula. That is the formula that gives the nth Fibonacci number. Then use logs. That is how I done it.

    nlog(\frac{\sqrt{5}+1}{2})-log(\sqrt{5})

    With some trial and error or solving we get n=4782.

    Which gives us 999.029410673

    We round up, so the first Fibonacci number with 1000 digits is the 4782nd one.

    Then we have 10^{.029410673}=1.07

    This tells us the first digit of this huge number is 1.
    Wow, that log idea is brilliant. I just don't know if I feel okay using someone else's formula :/ I suppose I used the formula for sum of i^2 on #6, but I think I figured out why it works one time, which makes me feel better about it.
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Did you use programming or just straight math? I've used math on 3 of them, but like #7 (find the 10001st prime number) seems like you would require programming to solve. (if there is a way to do it with just math, then you should give me a clue, I'd love to learn that)

    Well the 10001 prime problem is trivial if you already have tools for handling
    primes. First the 10001st prime ~ 100000 so it is well withing the capabilities
    of a modern computer. It takes my computer 16 ms to find all the primes less
    than 200000, and no time at all for me to pick out the correct one from the
    ~18000 primes found. (and this is an interpreted system!)

    In fact it would take more time to look the answer up in a table of primes!

    RonL
    Follow Math Help Forum on Facebook and Google+

  9. #9
    Super Member angel.white's Avatar
    Joined
    Oct 2007
    Posts
    723
    Awards
    1
    Quote Originally Posted by CaptainBlack View Post
    Well the 10001 prime problem is trivial if you already have tools for handling
    primes. First the 10001st prime ~ 100000 so it is well withing the capabilities
    of a modern computer. It takes my computer 16 ms to find all the primes less
    than 200000, and no time at all for me to pick out the correct one from the
    ~18000 primes found. (and this is an interpreted system!)

    In fact it would take more time to look the answer up in a table of primes!

    RonL
    Hmm, I spent the last day writing a program to find primes (my program is beautiful, btw). I timed it to 200,000 primes in about 3 seconds. Now I'm trying to figure out how to install GNU Multiple Precision Arithmetic Library so that I can answer #3, because I don't currently have any data types large enough to handle numbers that big.
    Follow Math Help Forum on Facebook and Google+

  10. #10
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by angel.white View Post
    Hmm, I spent the last day writing a program to find primes (my program is beautiful, btw). I timed it to 200,000 primes in about 3 seconds. Now I'm trying to figure out how to install GNU Multiple Precision Arithmetic Library so that I can answer #3, because I don't currently have any data types large enough to handle numbers that big.
    If you have a modern C compiler you could check if it supports the "long long int" type.

    Also you can munge doubles to do the job.

    RonL
    Follow Math Help Forum on Facebook and Google+

  11. #11
    Super Member angel.white's Avatar
    Joined
    Oct 2007
    Posts
    723
    Awards
    1
    Quote Originally Posted by a tutor View Post
    Oh no, I think I'm getting sucked back in.

    I solved 104 problems but ran out of questions I liked (or could do). I hadn't looked in for ages and now I see new interesting problems. I need to call a MA meeting.
    ^_^ I've gottan 16 so far. There are more that I can do, but I've decided that C is not a very good language, I frequently can't handle large enough numbers. I had downloaded a library to do it, but this required comlicated functions, and any operation at all which involved a number had it's own new function, (printing, adding, subtracting, dividing, etc) it took me 30 minutes to figure out how to divide and print out the answer :/ Also, it is a pain to read in files (I assume because windows .txt files have formatting or something, but I can make a similar file on linux and read it in correctly, then I import their .txt file and the reader won't work right, and I have to mess with it for an hour to get the file read in, then get it solved in under 20 minutes)

    So I'm picking up Ruby, then I'll try the others I have ideas about. Some of them I could solve now, like #3 by just plugging it into a prime factorizer, but I want to do them on my own, so I'm waiting on these. Others, like 181, I need to go back and reread ch 5 in my Discrete Mathematics book to be able to solve, but my schoolwork is pretty intense right now so I've decided to do that over Spring Break instead. And most of these will have to wait until then as well, though every now and then I find one I can solve in excel in about 10 minutes.
    Follow Math Help Forum on Facebook and Google+

  12. #12
    Senior Member Peritus's Avatar
    Joined
    Nov 2007
    Posts
    397
    Quote Originally Posted by angel.white View Post
    Just curious if anyone else on here does Project Euler.

    I started yesterday, solved 1, 5, 6, 7

    Project Euler
    I wish you hadn't told me about this site, it's pretty addictive, at least for me.
    I've already solved 20 problems (all in c++) and I can't stop.
    Follow Math Help Forum on Facebook and Google+

  13. #13
    Super Member angel.white's Avatar
    Joined
    Oct 2007
    Posts
    723
    Awards
    1
    Quote Originally Posted by Peritus View Post
    I wish you hadn't told me about this site, it's pretty addictive, at least for me.
    I've already solved 20 problems (all in c++) and I can't stop.
    Sorry >.< I've gotten a total of 18, though not in order. I haven't worked on it in a bit, because I had midterms last week, and a big project due in my Data Structures and Algorithms course at the end of this week, plus I'm a little frustrated with C, so I decided to learn Ruby to do the rest. I got 2 books on Ruby last week, but I'm going to wait until after I get my project done.

    Oh, and I'm going to reread ch5 in my Discrete Mathematics book, which is all about counting, there are so many problems on there that deal with counting that I can't get right now, that's kind of frustring to me, because they seem like they should be easy.

    Anyway, yeah, it is pretty addicting, but school is important enough to me that I've been able to put it off (school is also the only thing in 9 years that could get me to say "no" to my starcraft addiction). Best of luck to you in that regards and if you can't say no, there's also the other option: solve all the problems and there won't be any left
    Follow Math Help Forum on Facebook and Google+

  14. #14
    Member
    Joined
    Nov 2006
    From
    Florida
    Posts
    228
    I like the site but the problems usually are not all that interesting. I instead do problems on SPOJ (www.spoj.pl), just click problems in the left panel. I should warn that the problems are not listed in order by difficulty but rather by date added. thus you should sort the problems by the number of users that have solved them to get a better idea of difficulty.
    Follow Math Help Forum on Facebook and Google+

  15. #15
    Super Member angel.white's Avatar
    Joined
    Oct 2007
    Posts
    723
    Awards
    1
    So far I have done 55 problems, using Ruby and C.

    (Sometimes I use excel, sometimes pen/paper)

    These are the ones I have done
    green = solved
    red = unsolved

    (55/199)
    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,
    Follow Math Help Forum on Facebook and Google+

Page 1 of 3 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