Keep my promise not to work?
It sounds to me like you're asking this question in the  hope that someone will come along and tell you to do the right thing. Well, here goes: you need to do the right thing and not break your promise. 

Honestly, aside from the obvious moral and ethical argument (which by itself is already pretty compelling), even from a purely selfish and utilitarian point of view I don't see how anything good can come out of you surreptitiously solving the problem and then claiming your place as the sixth coauthor. Given that apparently this is not going to be a very major result or paper anyway, the only thing you will achieve is to make an already messy and acrimonious situation only more messy and acrimonious. Most likely the paper will never get written, and even if it does, everybody including you will come away with a bad taste and little to show for all their efforts and frustration other than a dubious coauthorship, whose value will be more than negated by the effects on the reputations of a few of the people involved, especially you for breaking an explicit promise.

With that said, I think there are two options that could potentially let you participate in the work and benefit from your idea without breaking any promises or acting dishonestly:


Tell A that you have an idea that may be used to attack the problem. Make it clear that you intend to honor your promise not to work on the problem, unless he gives you explicit permission to do so (until the 5-author paper is made public, at which time your promise becomes void anyway). At the same time, you are also under no obligation to tell him your idea, and may legitimately ask to be allowed to officially join the project (with the implied promise of coauthorship of the paper in the event that you end up making a meaningful contribution) as a condition of revealing your ideas to the group. They can then decide if that's something they're interested in or not - either way you are morally in the clear in my opinion.
In the event that you prefer not to discuss your idea with A and the rest of the group, or if you ask them to join the project and they refuse, you can simply wait until they make their results public, and then (as John Ma proposed in the comments) you will be free to use your methods to improve their results and publish your own paper, assuming your improvement is sufficiently interesting to make for a publishable result.


Finally, I should add that although six-author papers are relatively rare in pure math, there is nothing wrong or shameful about publishing such papers, and if each of the authors can indeed claim to have made a reasonably meaningful contribution, then the paper will still have positive value to everyone's careers. Furthermore, going from 5 to 6 coauthors does not involve such a major dilution of the credit (beyond the level to which it is already diluted), so if you have a genuinely new and useful idea to contribute that could make this a pretty attractive proposition for the existing coauthors.