Talk:Substring primes

From Rosetta Code

different than truncatable primes?

How does this differ from truncatable primes?--Nigel Galloway (talk) 15:07, 5 April 2021 (UTC)

It's a smaller list,   it includes substrings that are not truncatable.     -- Gerard Schildberger (talk) 15:39, 5 April 2021 (UTC)
See the OEIS entry:   A024770 right-truncatable primes.
See the OEIS entry:   A024785 left-truncatable primes.
See the OEIS entry:   A085823 numbers in which all substrings are primes.

If I create a set of primes less than 500 then filter such that for each member n the set contains n%10 shall I have completed this task with no prime tests?--Nigel Galloway (talk) 15:23, 8 April 2021 (UTC)

There seems to be a disagreement concerning what   is   a primality test,  so I will defer an opinion.     -- Gerard Schildberger (talk) 16:17, 8 April 2021 (UTC)
Nice try, but I think "the set contains" is itself a primality test, no? And is generating those 95 primes itself 500 primality tests? Admittedly that is slightly flawed logic since they would probably be quietly generated somewhere anyway. Also bear in mind this all started when I tried to find solutions > 373 when there aren't any... I have no problem with you or anyone else improving this task, although I stand by my claim that a limit of 500 is at best "misleading". --Pete Lomax (talk) 17:09, 8 April 2021 (UTC)


Removed utterly pointless limit of 500. Find 'em all, it's the same output, and encourages a little more thought than for i=1 to 500. --Pete Lomax (talk) 08:54, 6 April 2021 (UTC)

By removing the task's limit, you're invalided all but "your" solution.   The whole point of Rosetta Code   (well, at least one of them)   is to compare how different computer programming languages (and programmers) solve the stated problem (the task as stated).   Significantly changing the (draft) task's requirements (and/or wording) makes comparing the solutions at this point, pointless.   At this time, all but one programming solution uses a limit of some kind.     -- Gerard Schildberger (talk) 10:26, 6 April 2021 (UTC)
They are not invalidated at all, they all give the correct output, apart from the REXX entry which blatently lies about how many prime tests it performs (it's 26 btw, or 119 if you also count the digit-wise exclusions). Using a limit is a valid way to do it, just not a very smart one. I was only trying to make a rather pedestrian task into something slightly more interesting/challenging, optionally. If you want to change it to something like "This can be achieved by filtering all primes below 500 (there are 95 of them), but it can also be done by only checking 15 numbers." then I'll not complain. --Pete Lomax (talk) 13:34, 6 April 2021 (UTC)
The REXX entry does give the correct output.   Apart from your characterization of how (and what) the REXX entry counts as primality testing,   and I   (as the sole author of the REXX entry)   shouldn't be accused of being blatantly lying;   I didn't considering the elimination of various numbers using digit-wise filtering as a primality test,   but I don't want to get into useless and/or pejorative arguments about how one   counts   the number of primality tests and whether or not it was performed in a blatant manner (or not).   I added the primality counting in good faith and I don't see how you could label that as lying,   and blatant lying at that.   And, no, I do not want to change the task's requirements as per your suggesting such that you won't complain.   That's not how changing of someone else's Rosetta Code task's requirements is supposed to work.   Furthermore, please be more careful of calling people liars on Rosetta Code.     -- Gerard Schildberger (talk) 20:31, 6 April 2021 (UTC)
My apologies, the 119 was a step too far. I ran your code on tio and it displayed 26 rather than the 14 claimed in the output. I will admit that I do not know enough about the REXX programming language to understand why that might not be classified as blatent lying. I will not however apologise for nor promise to desist in making what I think are sensible proactive changes to tasks shortly after creation, particularly not when a task is utterly trivial and extremely similar to a very recent one. There is always the undo button but you are not interested in that. Ultimately I simply do not understand why you complain about such changes but not about the creation of the task in the first place. In other words how is (no task -> task) actually any different to (task -> modified task), really? There are many tasks on RC that I wish somone else would spot a way to improve or make more challenging and interesting. If I have to revisit my code, that should be and usually is a good thing. --Pete Lomax (talk) 08:08, 7 April 2021 (UTC)
I'm not sure if you understand what lying is.   You seem to be saying that the REXX program displayed one thing and claimed something else in the output   (at least, that's what I took from your statements).   Computer programs don't lie.   At worst, wrong (or inaccurate) results (or omissions) may be displayed, but (blatant) lying?   No.     And, again, try not to explain why you can't understand why I didn't do something.   If you want to know why I didn't do something, just ask me,   there's no need to guess wrongly on the reasons and try to formulate a strawman argument.   Please don't try to characterize or criticize something I didn't do.   That type of discourse isn't helpful nor constructive.   But you're completely wrong about my having no interest in the "undo" feature. Just because I very rarely use that feature,   it doesn't meant I haven't an interest in it.   I do not and will not use the "undo" button to remove someone else's changes   unless   a blatant error had occurred and a (partial or wholesale) loss of content was the result of (perhaps) someone's finger-slip and the author didn't see or realize it.   But just because I might disagree about someone's changes or additions to a task   (even a draft task),   I won't "undo" it.   That's not what the undo feature is for,   at least,   that's my opinion about that feature.     I don't understand your question about the that "no task-->task vs. task-->modified task" statement.   Modifying someone else's task (requirements), even a draft task,   usually causes the authors of existing solutions/entries to revise/change their computer programs to accommodate the revised/added/changed requirements, and this isn't counting the "extra credit" or "stretch goal" stuff.   But I do agree with you in that there're many tasks on Rosetta Code that could be improved or make more challenging/interesting.   But there are just as many tasks that that would be a disservice.   Take the many forms of a DO loop and various sorting algorithms and the like.   The intent is to make the requirements simple and straight-forward so that programmers can see the simplistic form/structure of the algorithm/structure so as to compare it to other computer programming languages.   If the requirements get too challenging, it may be difficult for a person (or novice) not familiar with a computer language to see the forest for the trees amongst the complexity of the code.   Making it challenging may deter programmers from spending the effort and offering solutions.   I believe in adding tasks   (and interesting ones at that)   if that encourages people in entering/creating solutions.   Any Rosetta Code task can be improved in some way.   But making a moving target just makes it complicated and it costs time and effort to re-write a computer program, even if it's a slight change.     -- Gerard Schildberger (talk) 09:38, 7 April 2021 (UTC)
OK, when I said "The REXX entry blatently lies", I meant no personal attack, I am sure you made an honest mistake. Despite my very best intentions, my own documentation (and program source and RC entries) almost certainly contain dozens of "blatent lies", a term I apply liberally to my own work, and should refrain from applying to that of others. But it is worrying when the output shown is wrong, as you have just done again on Palindromic primes.
Maybe the output was correct but the code was out of date - I have not seen any REXX version that could ever have possibly output a count of 14.
Sorry, but I am completely dumbstruck by your inability to comprehend new vs. modified task, and cannot say anything that would make that any clearer. --Pete Lomax (talk) 13:48, 7 April 2021 (UTC)
Your statement of:
                            In other words how is (no task -> task) actually any different to (task -> modified task), really?  
is the quote that I was referring to.   Whether you are dumbstruck or not, isn't the question.   I did and still do not understand why you think that I don't have the ability to comprehend the difference, as I don't feel I should have to enumerate the differences just to answer a nonsensical question, but that isn't germane.   If you can't explain what you meant in that context, and repeating the same text doesn't explain anything.   Your assumption about my understanding is faulty.     -- Gerard Schildberger (talk) 22:37, 7 April 2021 (UTC)
That just made things even worse. --Pete Lomax (talk) 17:24, 8 April 2021 (UTC)
I object to removing the limit. It invalidates my FreeBASIC solution which, despite being cheeky, illustrates an entirely different approach to the problem; one that does not involve converting to and from strings. Thebigh (talk) 15:37, 7 April 2021 (UTC)
Yes, exactly.   Removing the limit also invalidated my REXX solution (as well as others), which uses a filtering method instead of a completely different algorithm to generate and validate the possible substring primes.     -- Gerard Schildberger (talk) 23:19, 7 April 2021 (UTC)
No it did not. Why do you insist it did? --Pete Lomax (talk) 17:24, 8 April 2021 (UTC)
As I said above, it does not invalidate it in any way. Should a limit of 500 be used it will still find them all. But if the task says find those under 500, it implies there are more, when in fact there aren't. Still want the limit back? See my suggestion of 13:34 or perhaps if you like you can add "You may be relieved to hear that all such primes are below 500, if that helps." --Pete Lomax (talk) 15:58, 7 April 2021 (UTC)
Pete:   you posted in a recent edit summary:
                             (Against my better judgement, but I've had enough of this nonsense, and 
                             since some people are too weak-minded and lily-livered to do it themselves....) 
Ah!!   Nothing like spurious name-calling to make Rosetta Code a more friendlier place and make people feel welcome.   At least, that's what I read on some Rosetta Code brochure or somewhere.   But seriously, someone needs to take a chill pill.   It's pretty hard to take those words back   (or even to try to delete them).     -- Gerard Schildberger (talk) 18:54, 8 April 2021 (UTC)