Pupils from Nursery to Year 6 wrote their very own story based around a maths concept.