Code to calculate possible combinations for a Master combination lock given the last number in the combination. This source is in PHP.
<table summary="Possible Master Lock Combinations">
<caption>Possible Combinations</caption>
<?php
$default_c3 = 0;
$c3 = (int) isset($_GET["last_comb"])? $_GET["last_comb"] : $default_c3;
if ($c3<0 || $c3>39) $c3 = $default_c3;
for ($c2=($c3+2)%4; $c2<40; $c2+=4)
{
print "<tr>";
for ($c1=$c3%4; $c1<40; $c1+=4)
{
if ($c1-$c2==2 or $c1-$c2==6 or $c2-$c1==38 or $c2-$c1==34 or abs($c3-$c2)%36==2)
echo "<td> </td>";
else
echo "<td>$c1 - $c2 - $c3</td>";
}
print "</tr>\r\n";
}
?>
</table>

So nice to have it online. I have the Excel file if anyone wants it?
Posted by Dan Casta | July 8, 2012, 5:21 AMHi Dan,
I think it would be great to offer the excel file for download. Or you can give me the URL and I’ll link to it.
-Mike
Posted by Mike | July 9, 2012, 7:56 PMHelp! I have a Master Lock and forgot the combo! Serial Number 8000148
Posted by Jennifer | October 20, 2011, 8:24 AMDo you still need with lost combination to master lock?
Posted by Dan Casta | July 8, 2012, 5:20 AMDo you have the combination for the 8000148?
Posted by Terresa | April 12, 2020, 3:17 PMI’m iprmeessd! You’ve managed the almost impossible.
Posted by Lorena | April 16, 2011, 8:16 AMHow did you find this formula for master locks?
Posted by Rob | November 14, 2010, 11:39 PMIt was based on the physical limitations of the lock. One such limitation was the mechanical resolution was 1 or 2 numbers away from the published combination. So, if the published combo was 4-32-16, for example, 5-32-16 would work as well. Some may describe this as sloppiness in the lock mechanics.
Posted by Mike | January 26, 2011, 11:52 PMWhat about for a combination lock with numbers from 0 to 49?
Posted by matt | June 19, 2010, 8:22 PMCan you make it so that I can run this program on your website? I don’t have php on my computer. This would be an excellent utility for they iPhone.
Posted by TJ Mathews | September 27, 2009, 3:12 PMSure. Try this: Master Lock Combination Recovery
Posted by Mike | September 28, 2009, 1:06 AM