The Talmud (AZ 27b) and in the Tosfot talks about the issur to frequent the מינים and to cure by them:
לא ישא ויתן אדם עם המינים ואין מתרפאין מהן אפילו לחיי שעה וכו' שאני מינות דמשכא דאתי לממשך בתרייהו וכו'
Is another benefit permitted? For example, to receive a gift from him? Or the man became like an איסור הנאה , a דרבנן extension to the issur to benefit from an avoda zara?
is a mathematical concept, a man's creation, or he just was who Hashem choose to discover one of His world's rules?...
This seems like a subjective question of semantics, that is really unanswerable. A much better question would be whether learning mathematics is included in the statement of Tosafot. (On the basis of my previous comment I cannot fathom how it might be).