OFFSET
1,2
EXAMPLE
2413 is in this sequence because 2^0 + 4^1 + 1^2 + 3^3 = 2! + 4! + 1! + 3! = 33.
MATHEMATICA
Select[Range@20000, Total[(a=IntegerDigits@#)^Range[0, Length@a-1]]==Total[a!]&] (* Giorgos Kalogeropoulos, Mar 30 2021 *)
PROG
(Python)
from math import factorial
def digfac(s): return sum(factorial(int(d)) for d in s)
def digpow(s): return sum(int(d)**i for i, d in enumerate(s))
def aupto(limit):
alst = []
for k in range(1, limit+1):
s = str(k)
if digpow(s) == digfac(s): alst.append(k)
return alst
print(aupto(14000)) # Michael S. Branicky, Mar 30 2021
(PARI) is(n) = my(d = digits(n)); sum(i = 1, #d, d[i]!) == sum(i = 1, #d, d[i]^(i-1)) \\ David A. Corneth, Mar 30 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Carole Dubois, Mar 30 2021
STATUS
approved