Does "scut work" contribution to a paper as a math undergrad carry weight in grad school application? I got an opportunity to collaborate writing a mathematics paper with some professor at my university, but I'm suspecting my role won't be much more significant except doing menial work in the form of writing dozens of lines of code using Mathematica and helping my professor computing things. I can probably get in my name as a possible collaborator, but I am wondering is it really worth putting in the effort into it to do so?
While I'm aware that research experience is taken into account while considering grad school applications, I am also aware that putting into papers in which I had menial contribution into my CV might even carry negative weight, in the sense they might suspect I'm trying to game the system without really doing anything substantial.
Is it worth pursuing this project instead of, say, learning some new math by myself (not under the supervision of someone)? Even if I do, what are some ``red-flags&quot; to notice for, which can indicate this might not be a great idea?
[PS: I don't want to go into details regarding the subject matter of the paper, but it's a relatively advanced topic that requires a fairly good mastery of the core undergrad curriculum to understand. I believe I have such an understanding, but I'm not sure if my role in writing the paper would reflect that/I would have the opportunity to use my understanding, especially if I'm not considering the professor as my main recommenders for grad schools].
writing dozens of lines of code using Mathematica and helping my professor computing things

That sounds like normal undergraduate research to me.  It's probably not a menial contribution.  Very few people can write a dozen lines of Mathematica code.
If you do a good job, this could be a big help to your graduate school applications and even later career.