Chemical elements are defined by the number of #"protons"#, positively charged nuclear particles, present in their nuclei. This gives #Z#, the atomic number, which number arranges the Periodic Table.
#Z=1#, we have the element hydrogen, #Z=2#, we have the element helium, #Z=3#, we have the element lithium, ............#Z=24#, we have the element chromium. How do I know these numbers? Did I know them off the top of my head.
But the atomic nucleus can contain DIFFERENT numbers of neutrally charged, massive particles, i.e. NEUTRONS, and these neutrons give rise to the phenomenon of #"isotopes"#, which we can consider in relation to the simplest element, hydrogen.
Most hydrogen nuclei contain just the one particle, the one proton, and this defines the atom as a hydrogen atom, i.e. #Z=1#, A small number of hydrogen nuclei ALSO contain a neutron, as well as the characterizing proton. This is the deuterium isotope, which we represent as #""^2H#, as we represent the previous protium isotope as #""^1H#. A smaller of number of hydrogen nuclei contain 2 neutrons to give the tritium isotope, #""^3H#.
Most elements tend to have a few accessible isotopes, and their weighted average defines the atomic mass listed on the Periodic Table.
Back to your problem (finally!), the question specified that your atoms contained the same number of protons (and the neutral atom must necessarily contain the same number of electrons, why?). Thus, BY DEFINITION, if they contain different numbers of neutrons, THEY ARE ISOTOPES of the same element.