Based on a cursory investigation of the literature, it seems like ADHD can loosely be described as providing an extreme combination of "superfocus" on things that one finds interesting, and "super-distractability" on things that one doesn't find interesting. Different people with ADHD have different focus/distractability profiles across different things, so depending on who the person is and what you're asking them to do, ADHD might help or hinder their performance.
(As Sue VanHattum points out in the comments, plenty of non-ADHD people have attention "differences" where they can focus better on things that they are interested in than things they find boring. With that in mind, an attention "disorder" like ADHD might be characterized as an attention difference that is simultaneously extreme enough and unmanageable enough to cause severe distress and impediments in one's life.)
In particular, when ADHD people have trouble with math, it the issue is mainly due to impaired central executive functioning, which would suggest the issue primarily boils down to things like getting distracted and losing focus of the goal of a problem when one does not find it super interesting.
Friedman, L. M., Rapport, M. D., Orban, S. A., Eckrich, S. J., & Calub, C. A. (2018). Applied problem solving in children with ADHD: The mediating roles of working memory and mathematical calculation. Journal of Abnormal Child Psychology, 46, 491-504.
"CE [central executive working memory processes] ability fully mediated between-group differences in applied problem solving whereas math calculation ability partially mediated the relation. Neither PH STM [phonological short-term memory] nor VS STM [visuospatial short-term memory] was a significant mediator."
"Coordination within and between the two STM subsystems is superintended by the domain general CE to (a) determine the task-relevance of the information contained in the mathematical word problem; (b) update information in PH/VS STM with newer, more relevant information; (c) connect information contained in the mathematical word problem with knowledge stored in long-term memory regarding math rules and potential mathematical algorithms to be applied in the current problem; (d) maintain the overall ‘goal’ of the applied problem; and (e) sustain attentional focus while concomitantly inhibiting irrelevant information from entering/competing with temporarily stored information"
Raciquel posted a comment to a video where an ADHD mathematician describes his experience, and it sounds just like you'd expect based on the above -- basically, he's really "spikey" as opposed to well-rounded, and whether he feels his ADHD symptoms depends on whether he's doing things that are within his "spikes" of interest/ability/motivation.
How Getting a Math PhD Cured My ADHD (NOT)
"eventually I found something I felt so passionate about, I couldn't think of doing anything else. And that was applied math for me. And that ended up masking a lot of symptoms through grad school, and it wasn't until I left grad school recently in 2018 that my ADHD symptoms came back in full force."
He (Youngmin Park) describes how he actually struggled a bit with K-12 math due to the emphasis on memorizing formulas -- he didn't find that interesting, so he just rushed through homework, putting in the bare minimum amount of work for a passing grade. But he could be incredibly hyperfocused on other things (e.g. as a toddler, he would play with Legos for hours and hours and hours, forgetting to eat and sleep).
The thing that really drew him into math later on was a professor who sparked his interest in some particular research problems. He found grad school liberating because he had tons of freedom to follow his natural motivations/interests:
"I could work or not work whenever I wanted. I could work 12-hour days one day. I could work a 6-hour day the next day. I could take a day off the third day and go back to like a 14-hour day the day after that. And that was very liberating because my motivation doesn't start in the morning and fade off at night, it actually starts at very random times throughout the day and I can't predict when it comes about."
Basically, he's just really good at doing what he wants to do, when he wants to do it, on his own schedule. When he's in an environment that allows him to funnel that kind of effort into something productive, then he does really well. His impatience, impulsiveness, and obsessiveness become a superpower because he can just floor the gas and charge full-speed ahead on the stuff that he's interested in. But whenever he's in a context where this kind of behavior isn't a superpower, it creates tons of friction and becomes a super-weakness (he mentioned some examples in the video, e.g. romantic relationships).
As far as other ADHD mathematicians and their experiences, there are a bunch of famous academics in math and adjacent fields who are known not only for their contributions, but also for amusing backstories and habits that seem strikingly aligned with what Youngmin Park describes in his video above. Erdős, Einstein, Tesla, you get the idea. They all clearly have a high degree of attention "difference", and I would venture that at least some of them would have been properly diagnosed with ADHD if tested today.
Courtesy of Dave L Renfro, there are also plenty of relevant and humorous anecdotes about mathematician Norbert Wiener:
"... the time he reported the theft of his car to the police, only to discover that he had driven it to Providence for a talk and taken the train back; the conversation in an MIT hallway that he concluded by asking his interlocutor which way he had been heading when he stopped to chat, greeting the answer with 'Good! That means I’ve already had lunch.'"