This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A262091 #27 Jan 09 2016 14:10:13 %S A262091 136,919,2178,58618,89883,63804,2755907,8139850,144839908,277668893, %T A262091 304162700,4370652168,21914086555935085,187864919457180831, %U A262091 13397885590701080090,19095442247273220984552,108493282045082839040458,1553298727699254868304830 %N A262091 Amicable digital pairs: The smaller number of a pair (x,y) with x <> y such that, in decimal notation and with an appropriate number of leading zeros prepended, x=(x_m...x_1x_0)_{10}, y=(y_m...y_1y_0)_{10}, x = y_m^m + ... + y_1^m + y_0^m, and y = x_m^m + ... + x_1^m + x_0^m. %C A262091 If we allow x to be equal to y we get numbers such as 1, 153, 370, 371, 407, ... See A252648. - _Chai Wah Wu_, Jan 04 2016 %H A262091 D. Knuth, <a href="http://www-cs-faculty.stanford.edu/~knuth/amicable_digit_powers.txt">Table of a(n) and its mate for n=1..36</a> %H A262091 K. Oséki, <a href="http://dx.doi.org/10.3792/pja/1195523903">A problem of number theory</a>, Proceedings of the Japan Academy 36 (1960), 578-587. %e A262091 a(1) is amicably paired to 244, because 1^3 + 3^3 + 6^3 = 244 and 2^3 + 4^3 + 4^3 = 136. %o A262091 (Python) %o A262091 # print pairs with leading zeros %o A262091 from __future__ import print_function %o A262091 from itertools import combinations_with_replacement %o A262091 for m in range(2,11): %o A262091 fs = '0'+str(m+1)+'d' %o A262091 for c in combinations_with_replacement(range(10),m+1): %o A262091 n = sum(d**m for d in c) %o A262091 r = sum(int(q)**m for q in str(n)) %o A262091 rlist = sorted(int(d) for d in str(r)) %o A262091 rlist = [0]*(m+1-len(rlist))+rlist %o A262091 if n < r and rlist == list(c): %o A262091 print(format(n,fs),format(r,fs)) # _Chai Wah Wu_, Jan 04 2016 %Y A262091 A262092 has the larger element of each pair. Cf. A252648. %K A262091 nonn,base %O A262091 1,1 %A A262091 _Don Knuth_, Sep 10 2015 %E A262091 Definition clarified by _Chai Wah Wu_, Jan 04 2016