OFFSET
1,1
COMMENTS
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
LINKS
D. Knuth, Table of a(n) and its mate for n=1..36
K. Oséki, A problem of number theory, Proceedings of the Japan Academy 36 (1960), 578-587.
EXAMPLE
a(1) is amicably paired to 244, because 1^3 + 3^3 + 6^3 = 244 and 2^3 + 4^3 + 4^3 = 136.
PROG
(Python)
# print pairs with leading zeros
from __future__ import print_function
from itertools import combinations_with_replacement
for m in range(2, 11):
fs = '0'+str(m+1)+'d'
for c in combinations_with_replacement(range(10), m+1):
n = sum(d**m for d in c)
r = sum(int(q)**m for q in str(n))
rlist = sorted(int(d) for d in str(r))
rlist = [0]*(m+1-len(rlist))+rlist
if n < r and rlist == list(c):
print(format(n, fs), format(r, fs)) # Chai Wah Wu, Jan 04 2016
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Don Knuth, Sep 10 2015
EXTENSIONS
Definition clarified by Chai Wah Wu, Jan 04 2016
STATUS
approved