Maths prize June 2018: a pair of recursive functions

F(n) and M(n) are defined in a recursive, or doubling-back-on-themselves, way as:
F(n) = n─M(F(n─1))
M(n) = n─F(M(n─1))
F(0) = 1; M(0) = 0.
• By using a spreadsheet program with VLOOKUP, or by hand, calculate values of F and M up to n=55.
For most n, F(n)=M(n).
• What can you find about when F(n)≠M(n)?

Here are the first rows of the spreadsheet:

Longer list of F at

and of M at

F(n) is not equal to M(n) if and only if n+1 is a Fibonacci number.

The Fibonacci numbers are 1, 1, 2, 3, 5, 8, 13, 21, 34, 55… – each number formed by adding the two previous ones in the sequence.