Your old friend from college is visiting and brings back this weird electronic machine with him. He says that it's supposed to take input and spit out a number, but some prank was pulled on him (he was kind of a geek) where he, and the device, got dunked into the pool. It was turned on and your friend was electrocuted. Luckily he did survive (he did visit didn't he?) but during that shocking moment he forgot how his device worked, and the device was broken.
He came to you hoping you could help, he was hoping you could remember how it had worked. After you reply "no", he still wants help. He says you're the smartest person he knows.
Since it's broken the only information you have is a video you guys had took in college, and a weird note that had slowly been disappearing over the years.
In the video you guys were testing it. The few examples you could make out were:
$1863784 \rightarrow 1$
$1243242 \rightarrow 9$
$1742 \rightarrow 5$
The note seemed to be a set of instructions the computer followed:
Your friend was a terrible writer back then and his words were packed tightly together, therefore you couldn't distinguish any spaces. It was written in English.
Your friend needs your help to figure out how it works, and what the note says.
Just to clarify, you can do it in either order. Figuring out how it gets the number can be figured out easily by figuring out the note, or you could reverse the order and try to use the numbers to help figure out the note.