Just a thought...
This reminds me of the Factorial function. The same values will always be returned. With that in mind, it would probably be the best to store the inputs and the results in an NVP table and simply query the table for results. It's not like the list of Prime Numbers is going to change any time soon and, like a Tally Table, won't take very much room. If the system must remain "readless", then that may be another story but I can't imagine why a system would need to remain "readless".
So use Jonathan 's good function to generate such a table.
is pronounced "ree-bar
" and is a "Modenism
" for R
First step towards the paradigm shift of writing Set Based code:
________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.
"Change is inevitable... change for the better is not".
"If "pre-optimization" is the root of all evil, then what does the resulting no optimization lead to?"
How to post code problems
How to Post Performance Problems
Create a Tally Function (fnTally)