The initative will award $50,000 to a sharp programmer that can develop a middle-school application to teach crucial skills for the science and technology jobs of the future.

City schools contest will award programmers $50,000 for best mobile STEM app to improve middle-school math education.

City kids can’t bring cell phones to school — but they will be able to get a city-backed math app to help them with homework.

Mayor Bloomberg angered parents when he cracked down on cell phones in schools, but that doesn’t mean that the city can’t marshal the technology available on phones and computers to help kids learn, he said.

On Monday, he launched a contest offering $50,000 in cash prizes to programmers who craft the best middle-school math apps. He says it’s the first such contest in the country to be sponsored by a school district.

“We want the next great education technologies to come out of New York City,” Bloomberg said.

The city is beefing up science, technology, engineering and math, or STEM, education programs to position the city for the digital jobs of the future, and middle school math is crucial, Bloomberg said.

“Students who fall behind in middle-school math are likely to remain behind through high school and less likely to graduate ready for college,” he said.