Talk:Strange plus numbers: Difference between revisions

→‎Help with Description: Replied to CalmoSoft.
(→‎Help with Description: Added some comments.)
(→‎Help with Description: Replied to CalmoSoft.)
 
(6 intermediate revisions by 3 users not shown)
Line 5:
 
::: There's something [https://nrich.maths.org/722 here] but the definition is not the same as CalmoSoft's. Curiously, he always misses off the first column of output in his Ring solutions.
::::Funnily the first answer given was wrong. I don't know Ring, but what happens is quite obvious: when <code>(row-1) % 11 = 0</code>, a newline is printed but not the strange number. It should probably be <code>see nl + str</code> instead of <code>see nl</code>. [[User:Bastet|Bastet]] ([[User talk:Bastet|talk]]) 00:37, 25 February 2021 (UTC)
 
::: Hope there's not going to be too many of these - don't want another ''unixdict.txt'' situation! --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 10:17, 23 February 2021 (UTC)
 
:::: There appears to be a logic error in his code. Think the last bit should be:
::::<lang ring>if flag = 1
see " " + str
row = row + 1
if row % 10 = 0
see nl
ok
ok</lang> --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 10:55, 23 February 2021 (UTC)
:::@Chunes If the condition is "the sum of two consecutive digits is always prime", then one-digit numbers should be considered strange (it's [https://en.wikipedia.org/wiki/Vacuous_truth vacuously true] that for all pairs of consecutive digits the sum is prime). In the C solution I added a condition on n<10 to force them to be non-strange, but it's easy to remove. We could change the task to solve the general solution and decide what to do with one-digit numbers (I think it's better to have them strange). [[User:Bastet|Bastet]] ([[User talk:Bastet|talk]]) 13:33, 24 February 2021 (UTC)
 
Hello PureFox. I changed the code as you suggested (CalmoSoft)
 
:Good, thanks. Incidentally, I was just adding a Go entry to your [[https://rosettacode.org/wiki/Strange_numbers Strange numbers]] task, when I noticed there was a similar problem with your Ring entry. Same fix again, I think :) --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 10:14, 25 February 2021 (UTC)
9,476

edits