This was once India's version of an adding machine. In the absence of such devices, Indian bank clerks would frequently do their sums on banknotes. Now the practice has been forbidden and it's less common to get a banknote that's been written on, but it still happens.
A banknote with writing on it doesn't affect its value in India, and the Reserve Bank of India obliges banks to honour them at face value unless it's a political or religious message.
That's not the case if you try to exchange it outside India, where a defaced note might be worthless.
Back in 2016 the phenomenon of writing on Indian banknotes took a strange twist when someone – a jilted lover was the supposed culprit – wrote "Sonam Gupta bewafa hai", Sonam Gupta is unfaithful, on a 10 rupee note.
The note circulated, someone snapped a photo and posted it on online – and social media lit up. "Sonam Gupta" became a meme, and it still sometimes happens that the Sonam Gupta message will show up, even on a 2000 rupee note.