3 ms·
It could be a coincidence. About half of all 4-digit numbers contain at least one repeated digit. (Of 10000 possible numbers, 10 * 9 * 8 * 7 == 5040 contain fo
by finnw 14y ago
It could be a coincidence. About half of all 4-digit numbers contain at least one repeated digit. (Of 10000 possible numbers, 10 * 9 * 8 * 7 == 5040 contain four distinct digits.)
- ralph 14y agoRight, and about a quarter contain the same digit at least twice in a row, which may be the "double digit" the grandparent referred to. $ pins() { seq -f '%04.0f' 0 9999; } $ pins | egrep -c '(.)\1' 2710 $ pins | egrep -c '(.).*\1' 4960 $