Advertisement

Project Euler

Started by May 07, 2009 08:56 AM
27 comments, last by ChurchSkiz 15 years, 6 months ago
Quote: Original post by capn_midnight
Now then, unless you would care to point out a problem that strictly requires an implementation of Big Numbers, I really have to question what your point is for jumping all over my case.

Someone's a touch defensive. Just pointing out logical flaws in two of your statements: 1) Saying "I don't need big numbers" isn't nearly as an impressive claim when you've only done a fifth of the problems as it seemed when you first made your statement and 2) And 50 out of 243 isn't a "fairly decent sample size" when the sampling method is inherently biased. After all, it's not as if it's unheard of in a discussion forum to make comments on what people say.

But I'm sorry that you're so insecure that pointing out problems in your reasoning makes you feel so threatened. So, hey, don't let me stop you from bragging if that makes you feel better. I'm sure that whole "I'm superior because I don't need big numbers" thing must really help with the old self-esteem. Now that I think of it, I have to admit this is totally my fault; I should have known that someone who would post pictures of his car to random strangers would not be able to handle criticism on things that don't really matter well. The facts were there and I just didn't connect them. Mea culpa.
Quote: Original post by Zahlman
Quote: Original post by ChurchSkiz
largest prime factor of 6x10^17.


5. I can do that in my head. :D The actual given number is harder, of course, because it isn't so round.


A positive number, n, whose last digit is 0 is a multiple of another number, b, iff b has a last digit of either 5 or 0.

Also, the only prime number whose last digit that ends in a 5 or 0 is 5 because all other numbers ending in 0 or 5 are multiples of 5.

Quote: Original post by Zahlman
But if you think about how I could answer that so quickly, maybe you'll get some ideas about a better general implementation.


Sieve?
--------------------Enigmatic Coding
Advertisement
Interesting bit of trivia: the .NET framework has a BigNumber class, socked away in System.Numeric, but it's marked internal. I discovered it when digging around with reflector one day. I'm going to guess that they started working on it but didn't have time to thoroughly test it.
Mike Popoloski | Journal | SlimDX
Quote: Original post by SiCrane
Quote: Original post by capn_midnight
Now then, unless you would care to point out a problem that strictly requires an implementation of Big Numbers, I really have to question what your point is for jumping all over my case.

Someone's a touch defensive. Just pointing out logical flaws in two of your statements: 1) Saying "I don't need big numbers" isn't nearly as an impressive claim when you've only done a fifth of the problems as it seemed when you first made your statement and 2) And 50 out of 243 isn't a "fairly decent sample size" when the sampling method is inherently biased. After all, it's not as if it's unheard of in a discussion forum to make comments on what people say.

But I'm sorry that you're so insecure that pointing out problems in your reasoning makes you feel so threatened. So, hey, don't let me stop you from bragging if that makes you feel better. I'm sure that whole "I'm superior because I don't need big numbers" thing must really help with the old self-esteem. Now that I think of it, I have to admit this is totally my fault; I should have known that someone who would post pictures of his car to random strangers would not be able to handle criticism on things that don't really matter well. The facts were there and I just didn't connect them. Mea culpa.


Wow, someone's having a bad day.

Cap'n, for what it's worth, you did not come across to me as insecure or egotistical. :/
Quote: Original post by Mike.Popoloski
Interesting bit of trivia: the .NET framework has a BigNumber class, socked away in System.Numeric, but it's marked internal. I discovered it when digging around with reflector one day. I'm going to guess that they started working on it but didn't have time to thoroughly test it.

I seem to recall reading a blog post saying that it's used internally for crypto functions in the .NET framework, but I can seem to find it right now. But it's even weirder when you find out that Visual J# has a BigInteger class available in its runtime that is perfectly usable from other .NET languages, so it's not as if they don't already have a published .NET BigInteger class already out there.
Quote: Original post by anothrguitarist
Quote: Original post by Zahlman
Quote: Original post by ChurchSkiz
largest prime factor of 6x10^17.


5. I can do that in my head. :D The actual given number is harder, of course, because it isn't so round.


A positive number, n, whose last digit is 0 is a multiple of another number, b, iff b has a last digit of either 5 or 0.

Also, the only prime number whose last digit that ends in a 5 or 0 is 5 because all other numbers ending in 0 or 5 are multiples of 5.


I don't know what Project Euler question this is in reference to, but based just on what has been written here 6 * 10^17 is 3 * 2^18 * 5^17.
Advertisement
Quote: Original post by SiCrane
Quote: Original post by Mike.Popoloski
Interesting bit of trivia: the .NET framework has a BigNumber class, socked away in System.Numeric, but it's marked internal. I discovered it when digging around with reflector one day. I'm going to guess that they started working on it but didn't have time to thoroughly test it.

I seem to recall reading a blog post saying that it's used internally for crypto functions in the .NET framework, but I can seem to find it right now. But it's even weirder when you find out that Visual J# has a BigInteger class available in its runtime that is perfectly usable from other .NET languages, so it's not as if they don't already have a published .NET BigInteger class already out there.


Ye, I found this when I was doing some stuff that needed prime numbers, little fermat and all that jargon. .Net 2.0 did not have an arbitrary precision integer class. A lot of people who worked on scientific computing complained about this so in that crowd the announcement that it would be in .Net 3.0 was hailed as good news and not trivia. As bundling some J# library just felt unclean.

Of course people who used F# have had access to BigNum Ints since day one (.net 1.1 iirc), which incidentally, go well with lazy computationish computations.
Quote: Original post by anothrguitarist
Sieve?


I thought that due to the extreme length of the integer, a sieve would not be the direction to go. Though admittedly, neither was trial division.

I refined my algorithm after doing more research (was testing factors to n/2 instead of sqrt(n)) and I got the answer in under a minute. Still feels like "cheating" though.
Quote: Original post by nilkn
Quote: Original post by anothrguitarist
Quote: Original post by Zahlman
Quote: Original post by ChurchSkiz
largest prime factor of 6x10^17.


5. I can do that in my head. :D The actual given number is harder, of course, because it isn't so round.


A positive number, n, whose last digit is 0 is a multiple of another number, b, iff b has a last digit of either 5 or 0.

Also, the only prime number whose last digit that ends in a 5 or 0 is 5 because all other numbers ending in 0 or 5 are multiples of 5.


I don't know what Project Euler question this is in reference to, but based just on what has been written here 6 * 10^17 is 3 * 2^18 * 5^17.


I was simplifying. It is an 18 digit number that is not even. The largest prime factor is quite large (5 digits).

This topic is closed to new replies.

Advertisement