Count in Prime Palindromes!
Moderators: jestingrabbit, Moderators General, Prelates
Re: Count in Prime Palindromes!
76667
SexyTalon wrote:If it walks like a person, talks like a person, and tastes like a person, it's probably a person. Or I Can't Believe It's Not People, which cannibals prefer to Soylent Green nearly 5 to 1 in a blind taste test.
Re: Count in Prime Palindromes!
77377
The inequality of life: Nothing > Money
mx x = if head x == 0 then head (tail x) else mx (0:reverse (map head (groupBy (\x y > x>y) (reverse x))))
mx x = if head x == 0 then head (tail x) else mx (0:reverse (map head (groupBy (\x y > x>y) (reverse x))))
 e^iπ+1=0
 Much, much better than Gooder
 Posts: 2065
 Joined: Sun Feb 15, 2009 9:41 am UTC
 Location: Lancaster
Re: Count in Prime Palindromes!
77477
poxic wrote:You, sir, have heroic hair.
poxic wrote:I note that the hair is not slowing down. It appears to have progressed from heroic to rocking.
(Avatar by Sungura)
Re: Count in Prime Palindromes!
That's not true though  I don't know about it being palindrome, it might be, but it's not prime. Some of its factors include 2, 3, 4... 77976 and 77977.
She speaks in the third person
So she can forget that she's me
So she can forget that she's me
 BurningLed
 Posts: 561
 Joined: Tue Feb 09, 2010 5:42 pm UTC
Re: Count in Prime Palindromes!
93139
Axman wrote:Some people blow their cash on watches that they show off to people who think said watches make a person cool. Some people spend a weekend buying everyone fake gifts in a game of makebelieve.
I think the latter group is awesome.
Re: Count in Prime Palindromes!
duckshirt wrote:77977!
She wrote:That's not true though  I don't know about it being palindrome, it might be, but it's not prime. Some of its factors include 2, 3, 4... 77976 and 77977.
I sincerely doubt he meant the factorial of seventyseven thousand ninehundred and seventyseven so much as 77977 I can haz big prym! (wat iz same furwerd nd bakwud)
BurningLed wrote:93139
I believe that after 77977 come 78487, 78787, 78887, 79397, 79697, 79997, 90709, 91019 and then 93139. But I don't believe we have a defined interval (naturally, as will be true for primes) so I'll just go with 93239
The inequality of life: Nothing > Money
mx x = if head x == 0 then head (tail x) else mx (0:reverse (map head (groupBy (\x y > x>y) (reverse x))))
mx x = if head x == 0 then head (tail x) else mx (0:reverse (map head (groupBy (\x y > x>y) (reverse x))))
Re: Count in Prime Palindromes!
93339
Wow! This thread has been resurrected!
Also, I piped my code to an outfile, and now my lookup time is O(1). Not even amortized O(1). Just plain O(1).
Wow! This thread has been resurrected!
Also, I piped my code to an outfile, and now my lookup time is O(1). Not even amortized O(1). Just plain O(1).
Re: Count in Prime Palindromes!
Max2009 wrote:93339
Wow! This thread has been resurrected!
Also, I piped my code to an outfile, and now my lookup time is O(1). Not even amortized O(1). Just plain O(1).
Just out of interest, although a palindrome, how does 93339 avoid being a multiple of three? Anyway, 93739
The inequality of life: Nothing > Money
mx x = if head x == 0 then head (tail x) else mx (0:reverse (map head (groupBy (\x y > x>y) (reverse x))))
mx x = if head x == 0 then head (tail x) else mx (0:reverse (map head (groupBy (\x y > x>y) (reverse x))))
Re: Count in Prime Palindromes!
94049
Let this be a lesson to you youngsters: give your subclasses meaningful names.
In an attempt to be efficient and to write modular code I wrote a separate class to find palindromes, and a separate class to find prime numbers, and a third class to just instantiate the other two and run them, one after the other. (I know it's not efficient, but it's modular as hell.)
Having not looked at the code in several months, I forgot who did what, and just ran a class at random.
Clearly it was the palindrome class, not the primes.
Let this be a lesson to you youngsters: give your subclasses meaningful names.
In an attempt to be efficient and to write modular code I wrote a separate class to find palindromes, and a separate class to find prime numbers, and a third class to just instantiate the other two and run them, one after the other. (I know it's not efficient, but it's modular as hell.)
Having not looked at the code in several months, I forgot who did what, and just ran a class at random.
Clearly it was the palindrome class, not the primes.
Re: Count in Prime Palindromes!
94349
So I learned that short and neat is not always better than complicated and powerful. The efficiency of the language also helps. After seeing this thread's revival, I was inspired to rewrite my python code into C++. Piping the same inputs to python's source code and C++ source code took 20.02 seconds and 1.84 seconds, respectively, to calculate palindromic primes up to 10,000,000.
So I learned that short and neat is not always better than complicated and powerful. The efficiency of the language also helps. After seeing this thread's revival, I was inspired to rewrite my python code into C++. Piping the same inputs to python's source code and C++ source code took 20.02 seconds and 1.84 seconds, respectively, to calculate palindromic primes up to 10,000,000.
Re: Count in Prime Palindromes!
94649
I'm impressed with my code all over again. I ran it to 10,000,000 in 1680 milliseconds.
I'm impressed with my code all over again. I ran it to 10,000,000 in 1680 milliseconds.
 e^iπ+1=0
 Much, much better than Gooder
 Posts: 2065
 Joined: Sun Feb 15, 2009 9:41 am UTC
 Location: Lancaster
Re: Count in Prime Palindromes!
94849
Nice. Mine takes about 12 seconds to run to 10,000,000. Then again, I'm also using python.
Nice. Mine takes about 12 seconds to run to 10,000,000. Then again, I'm also using python.
poxic wrote:You, sir, have heroic hair.
poxic wrote:I note that the hair is not slowing down. It appears to have progressed from heroic to rocking.
(Avatar by Sungura)
Re: Count in Prime Palindromes!
94949
Talking about speed, this is why I love C++.
Generates prime palindromes up to 10,000,000 in < 15ms on my 2.4Ghz Core 2 Duo laptop. I don't know the exact running time because the timer resolution is only 15ms on Windows.
Talking about speed, this is why I love C++.
Spoiler:
Re: Count in Prime Palindromes!
95959
Nice code. Too bad about the Windows fail. Maybe when I have the time and patience I'll run it on my 2.4Ghz Centrino Duo 1 GB RAM laptop running Linux and we'll get a better resolution.
Be aware though that I'll be using the Gnu C Compiler, so the time might be a little different.
Nice code. Too bad about the Windows fail. Maybe when I have the time and patience I'll run it on my 2.4Ghz Centrino Duo 1 GB RAM laptop running Linux and we'll get a better resolution.
Be aware though that I'll be using the Gnu C Compiler, so the time might be a little different.
Re: Count in Prime Palindromes!
96269
awesome thread btw
awesome thread btw
Re: Count in Prime Palindromes!
Hurray for the necro!
96469
96469
Re: Count in Prime Palindromes!
96769
Also, I'm using mathematica. I'll probably switch over to python or C soon.
Also, I'm using mathematica. I'll probably switch over to python or C soon.
 Sean Quixote
 Posts: 229
 Joined: Tue Sep 14, 2010 1:20 am UTC
 Location: Ubekibekibekibekistanstan
Re: Count in Prime Palindromes!
97379
I was going to google a prime calculator or something, but then I remembered that I have the first 50 million primes saved on my computer...
I was going to google a prime calculator or something, but then I remembered that I have the first 50 million primes saved on my computer...
 Sean Quixote
 Posts: 229
 Joined: Tue Sep 14, 2010 1:20 am UTC
 Location: Ubekibekibekibekistanstan

 Posts: 563
 Joined: Tue Jul 27, 2010 8:48 am UTC
Re: Count in Prime Palindromes!
98389
I have discovered a truly marvelous proof of this, which this margin is too narrow to contain.

 Posts: 563
 Joined: Tue Jul 27, 2010 8:48 am UTC
Re: Count in Prime Palindromes!
98689, nobody said anything about double posting.
I have discovered a truly marvelous proof of this, which this margin is too narrow to contain.

 Posts: 563
 Joined: Tue Jul 27, 2010 8:48 am UTC
Re: Count in Prime Palindromes!
1003001 or triple posting, how about this, if no one has posted in the last 12 hours, then you can double post (or triple post etc) to keep the thread going.
Edit: Actually, we just reached a million, so I'll stop now.
Edit: Actually, we just reached a million, so I'll stop now.
I have discovered a truly marvelous proof of this, which this margin is too narrow to contain.
Re: Count in Prime Palindromes!
Isn't anyone else surprised that there were no six figure prime palindromes? And, if I'm not mistaken, this is because every six figure palindrome is evenly divisible by eleven....?
Also, where did it say the count was only going to a million, huh? Why not a billion?
P.s. These are a bitch to find using just Excel, so...... I got nothing.
Also, where did it say the count was only going to a million, huh? Why not a billion?
P.s. These are a bitch to find using just Excel, so...... I got nothing.
 Vytron
 Posts: 432
 Joined: Mon Oct 19, 2009 10:11 am UTC
 Location: The Outside. I use She/He/Her/His/Him as gender neutral pronouns :P
Re: Count in Prime Palindromes!
Yeah huh, there's no way I'm going to check manually if the next prime is a palindrome, or check all the following primes until I found the next palindrome, or check the next palindromes until I find a prime. It's much easier to just cheat:
1008001
1008001
Go! Go! You can do it username5243!
Cheers Marsh'n!
Your ad here. No, seriously! It's free! PM me if interested.
THANKS KARHELL!!
THANKS KARHELL!!
 Sean Quixote
 Posts: 229
 Joined: Tue Sep 14, 2010 1:20 am UTC
 Location: Ubekibekibekibekistanstan
Re: Count in Prime Palindromes!
1022201
Who is online
Users browsing this forum: No registered users and 36 guests