I've written a paper that [still] seems original to me and feedback tells me it needs work. The paper is about Pythagorean triples which has been done for ages but I've yet to find prior art on the [presumably new] Formula I created, the [mostly primitive and including all primitives] subset that it generates, or the ways I've shown that it and/or Euclid's formula can be used to find specific triples.
I did get help on Mathematics Stack Exchange on trigonometry and combinatorics to help prove some things and feedback that gave me an online source that shows one result of my work but not a method of achieving it. (My Formula demonstrates, perhaps, a new way of arriving at some conclusions but that's off topic.)
I'm not asking whether I should cite them. I'm asking how. I've written college papers 40+ years ago with footnotes and bibliographies but I don't know the techniques to be expect in a paper when submitting to a professional publication. I know how to show a link in MSE but I don't know how to show one in TexShop or even on this forum. One commenter suggested a book that I've ordered but I don't know how to cite that either if it is useful.
Can you show me the mechanics of citing these varied sources in a paper?