So, a friend of mine was bored one day and came up with this problem on his own (it related closely to some personal circumstances of his own). It intrigued me, but I have not been able to solve it.