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

No edit summary
 
(7 intermediate revisions by 3 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 20 ⟶ 32:
== 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,171

edits