  We apply an alloying strategy to single-layer PtN$_2$ and PtP$_2$, aiming to
obtain a single-layer Pt-P-N alloy with a relatively low formation energy with
reference to its bulk structure. We perform structure search based on a
cluster-expansion method and predict single-layer and bulk PtPN consisting of
pentagonal networks. The formation energy of single-layer PtPN is significantly
lower in comparison with that of single-layer PtP$_2$. The predicted bulk
structure of PtPN adopts a structure that is similar to the pyrite structure.
We also find that single-layer pentagonal PtPN, unlike PtN$_2$ and PtP$_2$,
exhibits a sizable, direct PBE band gap of 0.84 eV. Furthermore, the band gap
of single-layer pentagonal PtPN calculated with the hybrid density functional
theory is 1.60 eV, which is within visible light spectrum and promising for
optoelectronics applications. In addition to predicting PtPN in the 2D and 3D
forms, we study the flexural rigidity and electronic structure of PtPN in the
nanotube form. We find that single-layer PtPN has similar flexural rigidity to
that of single-layer carbon and boron nitride nanosheets and that the band gaps
of PtPN nanotubes depend on their radii. Our work shed light on obtaining an
isolated 2D planar, pentagonal PtPN nanosheet from its 3D counterpart and on
obtaining 1D nanotubes with tunable bandgaps.
