I dropped in on Ernie a few days ago. As I pushed open the door to his workshop I could hear a clanking, hissing noise and then saw Ernie emerging from a great clouds of steam, his face blackened with what looked like soot.
"Just in time to help me debug my calculator," he called out as he saw me.
"The clock-work calculator?" I asked.
"No. Clockwork is just so 20th century," Ernie retorted. "In my opinion, the future is in steam! Just let me stoke it up a little more and I can show you how it works." Ernie added a couple of shovels of coal to a small boiler and the hissing sound rose in intensity.
The calculator was a labyrinth of oily tubes, valves, gear-boxes, and brass widgets, like some sort of mechanically-augmented steam-punk tuba.
There were three long rows of clock-dials (each with a single pointer hand), each face numbered $0$ to $9$, and a small keyboard. The 14 keys were labelled with the digits 0 to 9 and the letters A, B, and D.
"If you press a series of digit buttons then the A or B button, you can load a number into the $A$ or $B$ register," he explained.
"What does the D button do?" I asked.
"That," Ernie replied, "is to test the Division and Decrement functions. The machine checks if $A$ divides perfectly into $B$ and, if it does, it completes the division and outputs $B \div A$ on the $C$ register. Then it decrements $A$ twice."
"What happens if $A$ doesn't divide into $B$?" I asked.
"Then it doesn't do anything. I haven't built in fractions or decimal points yet, and I hate approximate answers!" said Ernie.
Ernie asked me to type my 'lucky' 3-digit number into the $A$ register, but unlike Ernie I don't believe in lucky numbers, so I typed in the first number I could think of - which happened to be my auto-bank PIN $a$. When I pressed the A button, the indicator arms on the first three dials dial of the $A$ register swung round to point at the digits I had entered.
"Now enter a big number for the $B$ register," Ernie commanded. I typed in $n$ digits, but when I hit the B button, the first $n$ indicator arms all swung round to the digit $1$. Ernie muttered something about the steam pressure being too low to actuate the internal digital transfer mechanism (or maybe a sticky bypass needle actuator) but then pointed out that $b = 111111...11111$ was still a valid integer. "Try the D button now," he said.
I pressed D. The hissing and clanking rose in intensity, and the indicator arms on the $C$ register swung round wildly. After some seconds there was a mechanical "ding" and the arms froze in place, displaying a very long number in the $C$-register, and $a$ was decremented by $2$.
"Well at least Division and Decrementation work properly," said Ernie, after checking the results. "Lucky that your $a$ was a factor of that $b$. Try a few more divisions and I will see if I can sort out the problems with data-entry," he said.
So I left $a-2$ in the $A$ register and entered another number $b_2$ (of different length) into the $B$ register. Once again $b_2$ turned to all $1$s, and when D was pressed, an answer was output to register $C$ and $a-2$ was decremented to $a-4$. I repeated the process twice more without changing the $A$ register, and the same sequence of events occurred each time.
But after my fourth calculation Ernie waved me to a stop. "I think I have found part of the problem," he said. He made a small adjustment to a set of valves with a mallet and asked me to try again.
His adjustments had reset all the registers back to $0$, so I re-entered my 3-digit PIN into $A$, and entered a new $b$. My fingers were getting a bit tired from all the number pressing, so this time I just typed in a 6-digit number. But when I pressed B, there was still obviously a problem - the indicator arms all pointed at $0$s and $1$s.
"Not perfect, but better than before", Ernie said, then pointed out that I still had a valid 6-digit integer in the $B$ register and I should try the D button again.
As on all the previous occasions, $a$ divided perfectly into $b$, and after displaying an answer in the $C$ register, $a$ was replaced by $a-2$.
I repeated the process thrice more without altering the $A$ register, but typing a 7-digit, then an 8-digit, then a 9-digit number into the $B$ register (each constructed from $0$s and $1$s), and the same sequence of events occurred each time.
Eventually Ernie lamented that "...it might take a bit more thought to work out what is going wrong with data entry and decrementation, but at least it is doing the actual division perfectly." So we stopped for lunch.
"I suppose you will be telling this story on the web," he commented after we had eaten. I was surprised and a little embarrassed because I hadn't realized Ernie had even known about my stories. But Ernie reassured me that he didn't mind his 'web-presence'. "But if I can make a suggestion," he continued, "it might be safest to change your PIN if you are going to tell the story exactly as it happened."
Well - I did change my PIN even though I couldn't see how it could possibly be determined from my story. I'm guessing that Ernie was just playing a practical joke on me.
Can anybody tell me if it really is possible to calculate my old PIN from what I have told you?