How many 5 digit numbers with at least two digits prime and at least two digits square?
All digits are different and non-zero.
So I have seen this problem online and can’t find a solution so just wondering (i) if I’m correct and (ii) if there are any other ways out there.
My solution:
At least two digits prime and two digits square means that at most one digit has neither of these properties (N). We have 3 square (S) numbers and 4 prime numbers (P) in the range also.
Hence the cases are
NSSPP -> $2 \times 3 \times 2 \times 4 \times 3 =144$
SSSPP -> $3 \times 2 \times 1 \times 4 \times 3 =72$
SSPPP -> $3 \times 2 \times 4 \times 3 \times 2 =144$
Total = $360$
How’s my solution looking?
If it’s wrong why? If correct, are there any other methods
Edit: changes 6 to 2 in the first line as only neither digits are 6 and 8
As you observe we have three cases:
And
And
So the result is $4320+720+1440=6480$.