How to cite an answer in StackExchange? I will use this proof in manuscript. It is clearly plagiarism if I just write down the proof and do not cite the original content.  

However, how do I cite an answer in StackExchange? It is neither a blog post, nor a text in a personal website. It is an answer to a question. Should I go with traditional style such as


  [1] Gjergji Zaimi (stackexchange username) “Answer to Question
  'Unique ways to keep N balls into K Boxes?' ”
  https://math.stackexchange.com/a/58756/130361. Aug 2011. Last accessed:
  2017-02-12


or is there any formal method to do this?
There is a link at the bottom that provides a citation in bibtex or amsrefs format;



Clicking on this particular link the bibtex citation generated is;


  @MISC {58756,
      TITLE = {Unique ways to keep N balls into K Boxes?},
      AUTHOR = {Gjergji Zaimi (https://math.stackexchange.com/users/14274/gjergji-zaimi)},
      HOWPUBLISHED = {Mathematics Stack Exchange},
      NOTE = {URL:https://math.stackexchange.com/q/58756 (version: 2011-08-21)},
      EPRINT = {https://math.stackexchange.com/q/58756},
      URL = {https://math.stackexchange.com/q/58756}
  }


You could put that in your .bib file. From that point, it really depends how the rest of your citations are being formated. You might get something like;



That seems like a pretty standardised way to do it.