Correct way to add numbers to get lots of 8's
Bash + Common Linux utilities, 80

s=~0my3[_p^?{}s
h()(tr 0-9 $s&lt;&lt;&lt;$1|xxd -p)
dc -e$[0x`h $1`|0x`h $2`]P|tr $s 0-9aQ

Note the ^? in the source should be replaced with an ASCII 0x7f character.
The string s is each 7 segment digit 0-9, a, Q encoded with each segment corresponding to a bit of an ASCII char.
The h() function transliterates the input number from decimal to the encoding specified by s, then outputs the result as a raw hex string.
The two resulting raw hex strings are ORed together using regular bash arithmetic, then output by dc's P command as a bytestream.  This bytestream is then transliterated back to decimal + a + Q and output.
Note also that when using the &lt;&lt;&lt; bash herestring construct in function h() a newline is implicitly appended to the redirected string.  This doesn't matter - it is simply translated to 0x0a at the end of each hex string; when the two hex numbers are ORed together, the result is still 0x0a in the last char which doesn't get transliterated and thus simply translates back to a newline which is output after the result.
Test output:
$ for testcase in \
&gt; &quot;12345 123&quot; \
&gt; &quot;88888 42&quot; \
&gt; &quot;0 23&quot; \
&gt; &quot;1234 56789&quot; \
&gt; &quot;4 7&quot;; do 
&gt; ./7segadd.sh $testcase
&gt; done
12389
88888
28
58a89
Q
$