Talk:Truncatable primes: Difference between revisions

From Rosetta Code
Content added Content deleted
m (→‎redefinition of truncatable primes: indicated Latin phrase of ''per se''. -- ~~~~)
Line 26: Line 26:


:: It's not the base of the prime number(s) ''per se'', but when the description mentions taking the right- (or left-most) digits, those digits (in the case of truncatable primes) are specific to base ten. Prime numbers are prime in any (positive integer) base. Taking '''a''' digit from that expression of a prime requires specifying a base in this context. Indeed, there are only 83 right-truncatable primes in base ten, and 4,260 left-truncatable primes in base ten. -- [[User:Gerard Schildberger|Gerard Schildberger]] 19:59, 12 September 2012 (UTC)
:: It's not the base of the prime number(s) ''per se'', but when the description mentions taking the right- (or left-most) digits, those digits (in the case of truncatable primes) are specific to base ten. Prime numbers are prime in any (positive integer) base. Taking '''a''' digit from that expression of a prime requires specifying a base in this context. Indeed, there are only 83 right-truncatable primes in base ten, and 4,260 left-truncatable primes in base ten. -- [[User:Gerard Schildberger|Gerard Schildberger]] 19:59, 12 September 2012 (UTC)

:::Hi Gerard, I still can't see how talking about taking a digit would mean anything but a decimal digit from a base-10 representation of a prime? The task description on RC leaves out any mention of numerical bases. You introduce bases above when you talk of the number of right-truncatable primes but if you had just said that "There are only 83 right-truncatable primes" then wouldn't a base of 10 be automatically inferred? --[[User:Paddy3118|Paddy3118]] 21:48, 12 September 2012 (UTC)

Revision as of 21:48, 12 September 2012

Is Zero allowed?

I think the task should explicitly state whether zero is allowed in the numbers or not. If allowed then 999907 is the largest left-truncatable prime less than 1000000. --Tikkanz 00:58, 9 September 2010 (UTC)

Thanks Tikkanz. I've disallowed zero as this is done in part of the Mathworld article. It means disallowing '07' as being a prime for example, and seems reasonable. --Paddy3118 03:27, 9 September 2010 (UTC)

OEIS

For reference, a few of the related OEIS sequences are A024770 (right) and A024785 (left).

Phantom Category

I was trying to test cleaning up some categories of tasks (see Rosetta_Code:Village_Pump/Grouping_tasks) and thought I'd start with Primes, Prime, and Prime Numbers. So I added Category:Prime Numbers but low and behold I can't find where Truncatable_primes references Primes. In the html source there is a "wgCategories=[" inside a script and I can see at the bottom where a "Category:Primes (page does not exist)" is generated but I can't find where to fix this. Help? --Dgamey 10:29, 18 May 2011 (UTC)

Perhaps in the Clojure entry? --Rdm 11:11, 18 May 2011 (UTC)
Ah ha. Not Clojure, Haskell references a library called Primes. That has to be the wrong way to do it! It would create dozens of phantom categories all over RC. It has to be a primes member or package in some Haskell library. Is there a haskell user that can fix this out there? --Dgamey 11:26, 18 May 2011 (UTC)
If that's the real name for the library then that is the right way to do it. It may need to change to something like {{libheader|Primes (Haskell)}}. --Mwn3d 12:22, 18 May 2011 (UTC)

redefinition of truncatable primes

I think this task's definition of truncatable primes needs to be redefined to include the phrase base ten. It could be something like:

A truncatable prime (expressed in base ten) is a prime that when successive digits are removed from one end of the prime, all numbers thus found are prime.


or some such wording.
As an alternative, could MathWorld™'s definition be used? -- Gerard Schildberger 16:17, 12 September 2012 (UTC)

Hi Gerard, there is nothing in the task description implying a base at all and so usually we mean base ten. People talk about "the prime numbers" meaning the prime numbers in base ten without having to explicitly mention it and without confusion. You're not incorrect, (sorry about the double negative); but is it necessary. --Paddy3118 18:38, 12 September 2012 (UTC)
It's not the base of the prime number(s) per se, but when the description mentions taking the right- (or left-most) digits, those digits (in the case of truncatable primes) are specific to base ten. Prime numbers are prime in any (positive integer) base. Taking a digit from that expression of a prime requires specifying a base in this context. Indeed, there are only 83 right-truncatable primes in base ten, and 4,260 left-truncatable primes in base ten. -- Gerard Schildberger 19:59, 12 September 2012 (UTC)
Hi Gerard, I still can't see how talking about taking a digit would mean anything but a decimal digit from a base-10 representation of a prime? The task description on RC leaves out any mention of numerical bases. You introduce bases above when you talk of the number of right-truncatable primes but if you had just said that "There are only 83 right-truncatable primes" then wouldn't a base of 10 be automatically inferred? --Paddy3118 21:48, 12 September 2012 (UTC)