118 reputation
5
bio website icloud.com
location California
age 39
visits member for 1 year, 8 months
seen Feb 3 at 3:47

I'm just this guy, you know?

Originally a non-hockey playing, non-beer drinking Canadian, Tom moved to California to discover that he truly enjoyed beer and hockey (playing and watching). Settled in to a great job, Tom continues to find ways to mock himself and occasionally change the world. Tom also enjoys speaking about himself in the third person.


Jul
7
comment Algorithm to find greatest significant digit of long integer
Excellent! I'll give this a go. Like I said, the making it faster is only one aspect, I also really want to learn.
Jul
7
comment Algorithm to find greatest significant digit of long integer
Yes, I have a set of predefined numbers, in this case they're stored in memory as a set of long, signed integers.
Jul
6
asked Algorithm to find greatest significant digit of long integer
Aug
3
awarded  Scholar
Aug
3
comment The longest sum of consecutive primes that add to a prime less than 1,000,000
Thanks! This was the one that got me where I needed to be.
Aug
3
accepted The longest sum of consecutive primes that add to a prime less than 1,000,000
Jul
31
comment The longest sum of consecutive primes that add to a prime less than 1,000,000
I was able to calculate from 0..600 sliding windows in linear time, about 2 minutes. The real problem was it took nearly 2 minutes to calculate all the primes under 1M. (this is in python).
Jul
31
comment The longest sum of consecutive primes that add to a prime less than 1,000,000
This was super helpful as an optimization - but it was Steven Stadnicki who pointed out the real issue with my algorithm.
Jul
31
comment The longest sum of consecutive primes that add to a prime less than 1,000,000
Steven: Your comment gave me the key to figure out where I was being the most inefficient. I was able to move to a linear time calculation, where I was previously re-calculating the entire window each time, by keeping a previous 0..N I was able to 'slide' much faster. If you post an answer, I'll accept it.
Jul
30
awarded  Commentator
Jul
30
comment The longest sum of consecutive primes that add to a prime less than 1,000,000
Haven't forgotten about you guys, just had a crazy work weekend :(. I think I'll have time to test this out tonight.
Jul
26
comment The longest sum of consecutive primes that add to a prime less than 1,000,000
Hmm. Good point. That gives me something to optimize. Will return later tonight after work.
Jul
26
comment The longest sum of consecutive primes that add to a prime less than 1,000,000
It could be because I was trying to cover the whole space - IE: sliding windows of size 1..N where N = size of the list of primes < 1M
Jul
26
comment The longest sum of consecutive primes that add to a prime less than 1,000,000
I'm not actually looking for an answer. I'm looking to learn enough so that I can get the answers myself.
Jul
26
comment The longest sum of consecutive primes that add to a prime less than 1,000,000
Ok, I get that. If the list contains 2 (first N primes), the list needs to be an even number. Otherwise, it must be odd. That gets rid of 1/2 the problem space. And since I have a good idea of the amount of primes, I can make a set of sliding windows that do the calculations. I can probably answer the question, but I still think there's more learning that I need.
Jul
26
comment The longest sum of consecutive primes that add to a prime less than 1,000,000
Also note that the answer is not necessarily the first N consecutive primes.
Jul
26
comment The longest sum of consecutive primes that add to a prime less than 1,000,000
No, I understand how they are useful - I can look at the sum of the first N primes where 536 < N < 547 and find the one closest but less than 1M. And I have no doubt they are correct - but I want to find an efficient way to calculate them. If I just take them and solve the problem without understanding the answer, I'll be back in the same place when I go to solve later problems.
Jul
26
awarded  Autobiographer
Jul
26
awarded  Student
Jul
26
awarded  Supporter