Talk:Numbers with prime digits whose sum is 13: Difference between revisions

(→‎Changes in code: Suggested new name for task.)
 
(12 intermediate revisions by 5 users not shown)
Line 1:
==Nice recursive solution==
Starting with a set N containing the set of prime digits 2,3,5,7:
# add each digit in the set of prime numbers to each digit in N (giving 22,23,..,75,77 first time)
# add any numbers whose digit sum is 13 to the sequence;
# discard all numbers whose digit sum is greater than 11 from N;
# repeat until N is empty.
--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 14:44, 21 October 2020 (UTC)
: Thanks, seems everyone likes that. You can also start with 0 and a simple queue is probably even simpler than recursion. --[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]])
:: In coder speak a recursive function is a function that can call itself. Mathematically an algorithm is recursive if the output from iteration n of the algorithm is the input to iteration n+1 of the algorithm. In code this can be realized with a loop or in some languages a recursive function, either way the algorithm is mathematically recursive.--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 15:24, 23 January 2023 (UTC)
 
== output from  '''Ring'''  ends too soon ==
 
The reference implementation's output (Ring) currently ends at <code>7,222</code>. But there are more unlucky numbers. What about <code>222,223</code>? --[[User:Chunes|Chunes]] ([[User talk:Chunes|talk]]) 09:28, 29 September 2020 (UTC)
: "and sum of them is 13. " --[[User:Horst.h|Horst.h]]
Line 5 ⟶ 17:
 
== These are NOT unlucky numbers ==
Unlucky number have a long established definition and this is not it. (See [[oeis:A050505|OEIS A050505]].) These are "Integers in base 10 whose digits are all prime and sum to 13". or perhaps "Unlucky digit sums" My question is: what is the significance of the digits being prime? What property makes these numbers "unlucky"? If it is the summing to 13 why wouldn't <strike>168</strike> 148 be "unlucky"? --[[User:Thundergnat|Thundergnat]] ([[User talk:Thundergnat|talk]]) 10:20, 29 September 2020 (UTC)
 
== Changes in code ==
Line 12 ⟶ 24:
 
:I'd just call it 'Numbers with prime digits whose sum is 13'. --[[User:PureFox|PureFox]] ([[User talk:PureFox|talk]]) 11:02, 29 September 2020 (UTC)
 
== Change the task name ==
How can I change task name? <br>
If I could not then please change to: <br>
"Numbers with prime digits whose sum is 13"
 
== Thanks ==
Thanks for changing task name.
 
== task wording ==
Currently: &nbsp; &nbsp; Find all the numbers whose digits are all primes and sum to 13.
 
How about:
 
change to: &nbsp;&nbsp; Find all the decimal numbers whose digits are all primes and sum to '''13'''.
<br>or maybe: &nbsp; &nbsp; Find all the numbers (base ten) whose digits are all primes and sum to '''13.'''
 
:::::::: -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]])
2,172

edits