Legally, a 17 year old may have a sexual relationship with an adult no matter how much older that adult is. In Pennsylvania, there is a crime called "corruption of minors". It does not specifically mention sexual contact, but such a relationship may lead to violations of that law. The law is below:
§ 6301. Corruption of minors.
(a) Offense defined.--
(1) Whoever, being of the age of 18 years and upwards,
by any act corrupts or tends to corrupt the morals of any
minor less than 18 years of age, or who aids, abets, entices
or encourages any such minor in the commission of any crime,
or who knowingly assists or encourages such minor in
violating his or her parole or any order of court, commits a
misdemeanor of the first degree.
(2) Any person who knowingly aids, abets, entices or
encourages a minor younger than 18 years of age to commit
truancy commits a summary offense. Any person who violates
this paragraph within one year of the date of a first
conviction under this section commits a misdemeanor of the
third degree. A conviction under this paragraph shall not,
however, constitute a prohibition under section 6105
(relating to persons not to possess, use, manufacture,
control, sell or transfer firearms).
(b) Adjudication of delinquency unnecessary.--A conviction
under the provisions of this section may be had whether or not
the jurisdiction of any juvenile court has attached or shall
thereafter attach to such minor or whether or not such minor has
been adjudicated a delinquent or shall thereafter be adjudicated
(c) Presumptions.--In trials and hearings upon charges of
violating the provisions of this section, knowledge of the
minor's age and of the court's orders and decrees concerning
such minor shall be presumed in the absence of proof to the
(d) Mistake as to age.--
(1) Whenever in this section the criminality of conduct
depends upon the corruption of a minor whose actual age is
under 16 years, it is no defense that the actor did not know
the age of the minor or reasonably believed the minor to be
older than 18 years.
(2) Whenever in this section the criminality of conduct
depends upon the corruption of a minor whose actual age is 16
years or more but less than 18 years, it is a defense for the
actor to prove by a preponderance of the evidence that he
reasonably believed the minor to be 18 years or older.