Small thing i made in my spare time

Discussion in 'Offtopic' started by chugga_fan, Mar 24, 2016.

  1. chugga_fan

    chugga_fan ME 4M storage cell of knowledge, all the time

    Messages:
    5,861
    Likes Received:
    730
    Local Time:
    9:47 PM
    starts at 3, then goes 5, 7, 11.. so on and so forth, i updated to your method, the code will work fine, the only thing that actually throws ANY memory errors is visual studio itsself, otherwise it's just fine, i'll completely move over to the lucas-lehmer method soon^tm and get it to only check that number in the sequence
     
  2. aD0UBLEj

    aD0UBLEj Well-Known Member

    Messages:
    138
    Likes Received:
    17
    Local Time:
    2:47 AM
    Yeah the issue with this is it requires knowing if a given number is prime for each number up to root of the prime you want to check, which due to the size is just not possible as it is already past the current largest known prime by quite a large factor as I said before.

    Lucas-lehmer is the current best known algorithm for checking primality of mersenne primes, brute force just can't cut it when the 11 largest known primes are all mersenne and range from 4 million digits to 22 million, there are likely to be several unknown primes in that range.

    When you implement fully just make sure the final value of the S_k from the loop is actually S_(p-2) (as i wasn't quite sure if i'd got right)
     
  3. chugga_fan

    chugga_fan ME 4M storage cell of knowledge, all the time

    Messages:
    5,861
    Likes Received:
    730
    Local Time:
    9:47 PM
    i did, check out my most recent commit, i basically commented out a HUGE ammount of code, going to add the normal mersanne prime checker, with a lucas-lehmer that DOESN'T save the value it's at to a file, (the main one DOES, and the file gets BIG, fast), try to keep most of this to the github now though ;)
     
  4. aD0UBLEj

    aD0UBLEj Well-Known Member

    Messages:
    138
    Likes Received:
    17
    Local Time:
    2:47 AM
    If I knew how to use github properly xD
     
  5. chugga_fan

    chugga_fan ME 4M storage cell of knowledge, all the time

    Messages:
    5,861
    Likes Received:
    730
    Local Time:
    9:47 PM
    issues -> new issue -> "Optimization problems" as the title -> post stuff in that
     
  6. chugga_fan

    chugga_fan ME 4M storage cell of knowledge, all the time

    Messages:
    5,861
    Likes Received:
    730
    Local Time:
    9:47 PM
    Update: i've done 4 releases since the first post here, the newest update needs some testing for option two, and i'd like everyones input on it, thanks ;)
     
  7. coolgi3000

    coolgi3000 Logician of the gods

    Messages:
    1,064
    Likes Received:
    282
    Local Time:
    9:47 PM
    isn't there some kind of prize or something for finding higher prime numbers?

    Edit- heres what i found on wikipedia

    Prizes
    The Great Internet Mersenne Prime Search (GIMPS) currently offers a US $3000 research discovery award for participants who download and run their free software and whose computer discovers a new Mersenne prime having fewer than 100 million digits.

    There are several prizes offered by the Electronic Frontier Foundation for record primes.[5] GIMPS is also coordinating its long-range search efforts for primes of 100 million digits and larger and will split the Electronic Frontier Foundation's US $150,000 prize with a winning participant.

    The record passed one million digits in 1999, earning a $50,000 prize.[6] In 2008 the record passed ten million digits, earning a $100,000 prize and a Cooperative Computing Award from the Electronic Frontier Foundation.[5] Time called it the 29th top invention of 2008.[7] Additional prizes are being offered for the first prime number found with at least one hundred million digits and the first with at least one billion digits.[5] Both the $50,000 and the $100,000 prizes were won by participation in GIMPS.
     
    Last edited: Apr 5, 2016
  8. chugga_fan

    chugga_fan ME 4M storage cell of knowledge, all the time

    Messages:
    5,861
    Likes Received:
    730
    Local Time:
    9:47 PM
    wow, that's exactly what i said, lol, but my software is specifically made to do more than just mersenne primes, it does all sorts of things, such as branching out for the numbers (so you're processing 2 numbers at once in both directions from the given) so that you can check all the numbers below aswell to see if you missed any, will add stuff to make it go in a loop until it hits both directions a prime number, but basically yhea, that's the point of what i made
     
  9. Matryoshika

    Matryoshika Well-Known Member

    Messages:
    1,193
    Likes Received:
    606
    Local Time:
    3:47 AM
    Actually Chugga, you might be interested in BigInt...
    It allows you to go past the max-integer wall, up to a number composed of (2^31)-1 digits, as that's the max value a string (or a representation of one) can be, and doing this without actually printing the primes....
    Though unless you have a method of saving "discovered" primes to a central database, I do not see anyone getting close to that wall anywhere soon.

    Oh, and have you ever thought of placing the primes in an Ulam Spiral? Essentially, it's a spiral starting with "1", with "2" to the right of that, "3" on top of the "2", and going round. Primes create an interesting pattern in this formation.
    More info, and Ulam Spiral visualization can be found here.
     
  10. chugga_fan

    chugga_fan ME 4M storage cell of knowledge, all the time

    Messages:
    5,861
    Likes Received:
    730
    Local Time:
    9:47 PM
    Prime-Search/LucasTests.cs at master · chuggafan/Prime-Search · GitHub
    Already am, ;) also the main function starts at 2^(2^((2^5)-1)-1)-1, aka (2^MaxInt)-1, i will eventually figure out a nice database type thing, but it'll have to be done so that people can't interfere and give bad results to it
    I don't think i can do that in a console application and would need to do a LOT of c# work to get it
     
  11. Matryoshika

    Matryoshika Well-Known Member

    Messages:
    1,193
    Likes Received:
    606
    Local Time:
    3:47 AM
    Hmm, have it done like most scientific irrational calculations? That is, require minimum of 2 separate searches to provide the same sum; If person[1] sends in x, person[2] sends in x-1 & person[3] also sends in x-1, then by logic, person[1] would (likely) have been tampering with the result
     
  12. chugga_fan

    chugga_fan ME 4M storage cell of knowledge, all the time

    Messages:
    5,861
    Likes Received:
    730
    Local Time:
    9:47 PM
    would also need to figure out proper database design as atm i don't have the money to run a sql server, protect it properly (I know people who can prevent SQL injection attacks though), and all of that jazz, i'd also have to get it so they send information without actually needing passwords and that stuff, so it's a bit more complicated than that, other than that i also need to figure out how to make the program work for UNIX systems, it's all in c# and c# required microsoft libraries....
     
  13. Matryoshika

    Matryoshika Well-Known Member

    Messages:
    1,193
    Likes Received:
    606
    Local Time:
    3:47 AM
    Home | Mono
    You should only have to import your code, and then be able to get UNIX compatible versions
     
  14. chugga_fan

    chugga_fan ME 4M storage cell of knowledge, all the time

    Messages:
    5,861
    Likes Received:
    730
    Local Time:
    9:47 PM
    I've known about mono, the problem is most of what i've written so far has been on only windows 10, i haven't done enough testing on setups that can't take heat enough (i run it on my fairly high end i7 core laptop), alot of my current problems is optimizations, such as i can only have it run on 1 core atm as i don't exactly know how to do parallel programming in c# (i'm not fairly advanced in it), i'm also fairly certain i am using .net core atm which should run along with mono, alot of my problems are ones that i can't currently solve on my own and (ab)using stack overflow (they complicate alot of things too much), there's a lot of development that i'd like to do (setup a web page for it, etc) that i just can't, but other than that it's somewhat fully fledged enough that it's workable (finds random mersenne primes, normal primes, tests for double mersenne primes, and tests for the largest currently testible mersenne prime atm)
     
  15. coolgi3000

    coolgi3000 Logician of the gods

    Messages:
    1,064
    Likes Received:
    282
    Local Time:
    9:47 PM
    Its a lot easier to test if a specific number is prime than it is to just test every number from scratch right? what if u used some of those structures like the spiral and that one triangle thing (and probably more im not thinking about) to find the most probable next prime number, then test just the numbers in that area that could be prime. It would be pretty simple to make a statistics program to do that once u have one for the spiral and that kind of stuff.
     
  16. chugga_fan

    chugga_fan ME 4M storage cell of knowledge, all the time

    Messages:
    5,861
    Likes Received:
    730
    Local Time:
    9:47 PM
    Thats... what i do.... i ignore all the easy ones, and go for the fastest gaurenteed method that ISN'T using a sieve, as going out with a sieve would just be work for me to implement and check against the sieve... sooo
     

Share This Page