Upper index in table of contents

Lets say I have a Heading title 2^3=8 in it. Normally, you write it without ^ sign and with 3 in upper index level: 23=8

It works, but
in the table of contents I can see 23=8 - all the letters are normal size. Any suggestions?

Rather than use superscript to raise the character use a superscript character in the font. Arial and Times New Roman both contain 1 2 3 as superscript characters. 3 for example is U+00B3. Some fonts, like DejaVu Sans contain more superscripted numbers. As these are inserted, unmodified, they show up the same in both the heading and the TOC

That is why I mentioned “Some fonts, like DejaVu Sans contain more superscripted numbers.” in case you need more than 1 2 3. U+2070 to U+2079 is 0-9 as superscript (U+2080 to U+2089 subscripted numbers). Also + - ( ) in both sub and superscript

Thanks peterR but I need more characters than the dedicated 1,2 and 3.