P
Paul Black
Brilliant Dana, thanks VERY much for the detailed explanation and
code.
Your code will satisfy several other tests I want to produce very
nicely that use a single set of numbers.
I like the idea of checking that all combinations are present, very
neat.
Could you please explain what the variables "R", "n", "NPrime",
"PrimeQ" & "S" actually do please. It appears that the variable "R"
means one thing at the beginning of the code and something else
further down.
I would like to do two more tests, mainly count the number of Odd &
Even numbers, but that involves two scenarios, one for Odd & the other
for Even. The results should be as follows :-
0 Odd + 6 Even = 134,596
1 Odd + 5 Even = 1,062,600
2 Odd + 4 Even = 3,187,800
3 Odd + 3 Even = 4,655,200
4 Odd + 2 Even = 3,491,400
5 Odd + 1 Even = 1,275,120
6 Odd + 0 Even = 177,100
Totals > = 1,3983,816
I would like to do this by using the actual Odd & Even numbers in the
code itself, because there are other tests I want to produce that also
require using two seperate sets of numbers. That way, I can just enter
the new sets of numbers.
Thanks in Advance.
All the Best.
Paul
code.
Your code will satisfy several other tests I want to produce very
nicely that use a single set of numbers.
I like the idea of checking that all combinations are present, very
neat.
Could you please explain what the variables "R", "n", "NPrime",
"PrimeQ" & "S" actually do please. It appears that the variable "R"
means one thing at the beginning of the code and something else
further down.
I would like to do two more tests, mainly count the number of Odd &
Even numbers, but that involves two scenarios, one for Odd & the other
for Even. The results should be as follows :-
0 Odd + 6 Even = 134,596
1 Odd + 5 Even = 1,062,600
2 Odd + 4 Even = 3,187,800
3 Odd + 3 Even = 4,655,200
4 Odd + 2 Even = 3,491,400
5 Odd + 1 Even = 1,275,120
6 Odd + 0 Even = 177,100
Totals > = 1,3983,816
I would like to do this by using the actual Odd & Even numbers in the
code itself, because there are other tests I want to produce that also
require using two seperate sets of numbers. That way, I can just enter
the new sets of numbers.
Thanks in Advance.
All the Best.
Paul