"Den unge herr Petersen (Og det var den unge herr Petersen)" [Danish title] is number 2138 in the Hans Christian Andersen Center's register of Andersen's literary works, i.e. no. 638 in the category poems (the range 1501 - 2900). BFN 725.
"Den unge herr Petersen (Og det var den unge herr Petersen)" [Danish title] was first published 19 December 1854. Further information: Digterens danske Værker 1822-1875 number 725.
The work was published as a part of Samlede Skrifter af H. C. Andersen. - Sextende Bind [Danish title]. (Number 1018. BFN 676. Category/genre: Collected and miscellaneous writings).
In modern Danish on p. 536 in Johan de Mylius (editor): H.C. Andersen. Samlede digte ('Collected poems', Copenhagen, 2000).