I cannot find any explanation of the mathematical form of the single-mode photon number states, i.e. the |n>.
I take them to be functions with domain {0,1,2,3, …} and appropriate associated outputs.
So |3> I take to have outputs {0,0,0,1, 0, …} , |0> to have outputs {1,0,0,0, 0, …} and...