Someone made a computer program calculate the sequence of π and e sequentially.
The program only uses integer, addition, subtraction, array and loops.
The program is slow, but it doesn't stop and keeps printing the next number.
What are mathematical principles? Is there mathematical algorithm or recurrence relation or some formula?
Working in binary (or hexadecimal, etc.) every multiplication/division is a chain of shifts and additions. And so are additions and subtractions.
Therefore any recurrence (like that of Archimedes for $\pi$), infinite series or product defining $\pi$ , $e $ can be converted into binary as a sequence of shifts and additions which will operate only on a certain portion of the less significant digits.