This question has been boggling me for quite sometime now. I did go through all the equally related question on this site such as this,this one here and this, but they basically talk about the number of overall combinations that can exist for a pattern lock algorithm. I however, am looking for something more specific.
Here is the problem.
I own a windows phone with 5 inch of display, and has a 4 digit lock code for the lock screen. Because of the bigger display it is easier for someone who is along with me(my wife to be precise) to know what numbers I am pressing to unlock my phone. If not at first but after may be 3rd or the 4th effort.
The numbers on the lock pad are in this fashion
$$1 2 3\\4 5 6\\7 8 9\\ 0 $$
I realized that if I say use lock pattern of 9731, I am increasing the chances of the code to be cracked. However, If I use something like 3622 where the numbers form closed loop with less separation the visibility is less and hence the code is strong. This was the longest running code that I had, because it was hard to crack open.
I then sat down and classified these 4 digit codes into something called as 'strengthful numbers' (I could not find any other name for them)
The classification is :
- Numbers form closed loop with less separation- $1$ unit adjacent
- Numbers can repeat but at max 2 times. eg. 2452
- Common patterns, need be ignored like 1234,2345.
Now, to my attempt.
I considered that distance between 2 numbers horizontally (1-2,2-3), and vertically(3-6,2-5 etc) is 1 units, then my objective should be to visualize triangles within that lockpad that have perimeter as 3 units or squares with 4 units and not more.
So far, I can visualize 10 such triangles and through brute force method I see $1451,2562,3563$ and so on.
Is there a more convenient, mathematical way of calculating how many possible combinations of the above criteria exist?
.