A nerdy teacher at prestigious Brooklyn Tech HS sexually victimized at least seven female students — and even rewarded one with perfect grades, authorities said Tuesday.

Teacher Sean Shaynak “would routinely give [one teen] 100s in his class even though she turned in work with no answers,” Brooklyn prosecutor Joseph Mancino said at the suspect’s arraignment.

The bespectacled, bow-tied professor, 44, “groomed’’ his young victims for sex while teaching math and science at the famed school, which counts Mayor de Blasio’s son, Dante, among its students, authorities said.

A licensed pilot, Shaynak also ran the school’s Aerospace Club — where he was known to cozy up to the prettiest students.

“He’d always have students come visit him, kids that were not in the club, mostly very good-looking girls, the best-looking girls in our school,” said Alan Chambers, 16, a junior in the club.

Shaynak, who lives in Flatbush, was busted in August after allegedly sending a “selfie” of his penis to a female student.

Once investigators pored through his computers and phones, they discovered evidence — thousands of texts, photos and videos — that he had inappropriate sexual contact with girls ages 13 to 19 starting in 2011, authorities said.

“The defendant clearly looked to groom these students,” Mancino said as Shaynak was held on $1 million bail.

Mancino described one perverted four-month relationship Shaynak had with a student.

“He brought her to a sex club out of state, where he performed sex acts on other people and other people performed sex acts on him,” Mancino said.

Shaynak — who isn’t married but has a 9-year-old daughter — also took a 15-year-old girl to a nude beach in New Jersey, plied her with “Jack Daniel’s and tequila to the point where she passed out” at his house, traded over 10,000 text messages with her and tried to talk her into having a lesbian relationship with another underage student, Mancino said.

“Blondes, brunettes, Asians, Hispanics, Middle-Eastern — he was an equal-opportunity predator,” a law-enforcement source said.

Law-enforcement sources said Shaynak purposefully didn’t have sex with girls under 17 to avoid statutory-rape charges.

But he did have consensual sex with two students, ages 18 and 19, and touched and kissed other underage girls and sent photos of his genitalia to four students, including two minors, prosecutors said.

The suspect — dressed in a suit and necktie instead of the goofy bow ties he favored in school — was dripping sweat as he sat in handcuffs at court.

His lawyer, Kim Summers, tried to explain away the 10,000 text messages — by blaming the girl.

“One of them was routinely contacting him, and that might explain the voluminous text messages,” Summers said.

Shaynak was charged with kidnapping, unlawful imprisonment, criminal sexual act, forcible touching and sexual abuse. He pleaded not guilty.

He has been in a “rubber room” — a Department of Education status removing him from the classroom with pay — since his August bust, and makes about $52,000 a year.

Additional reporting by Kevin Sheehan