OFFSET
1,1
MAPLE
For Maple code see A058906.
MATHEMATICA
base=8; Do[k=n; While[Apply[Plus, IntegerDigits[k, base]] n!=k&&k<250n, k+=n]; If[k==250 n, Print[n]], {n, 1, 10^3}] (* Vincenzo Librandi, Sep 21 2017 *)
PROG
(Python)
from itertools import count, islice, combinations_with_replacement
def A058904_gen(startvalue=1): # generator of terms
for n in count(max(startvalue, 1)):
for l in count(1):
if 7*l*n < 1<<3*(l-1):
yield n
break
for d in combinations_with_replacement(range(8), l):
if (s:=sum(d)) > 0 and sorted(oct(s*n)[2:]) == list(map(str, d)):
break
else:
continue
break
CROSSREFS
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Jan 09 2001
STATUS
approved
