How to write a technical paper of a not so significant idea? I am a PhD researcher in my first year. For the first 3 months all my supervisor made me do was read related papers on IEEE, so a LOT of literature review.

Recently in trying to recreate the result of another paper I was reading, I wrote some code on segmentation that appears to work really well and has got my supervisor's attention and interest. He thinks this may lead to a publication.

He asked me to write a technical report on it. So I wrote a simple report in MS Word which included a brief explanation of the method with graphs and result images but he said this is not what he wanted. What he expects from me is a IEEE style report/paper, including introduction, algorithm/method explanation, mathematical representation, experiments, future work etc.

The problem is that I believe he thinks too highly of my code, its just a for loop applied at different settings. That is all..

What is the mathematical representation of a for loop? How do I make it look more professional? As I know my reports are those of an undergrad standard.
Quite possibly, your supervisor is encouraging you to write early, to learn how to write, and to get into the habit of writing your results down.

You would gain a lot by watching this youtube video by Haskell inventor Simon Peyton Jones on How to write a great research paper. Part of his message is that you can do the research while you are writing, meaning that many ideas will come to you as you are writing things down.

You ask how to write a paper. Didn't you just read a whole bunch? Pick one that you found easy to follow and inspiring. Model your paper on its structure and style.

Regarding the actual work. A formal model of a for-loop has already been done, so I suspect that this is not the right level of abstraction to consider. What is the data to which your for loop applied? What did it mean? What did the parameters mean? How are the results of your code interpreted? Were some better than others? On what scale?
Part of science is learning to ask and answer the right questions.