R, 124124 112 bytes
f=function(N){y=x=`if`(N-1,f(N-1),0);while(N!=prod(y)&N!=sum(y)){x=x+1;y=as.numericdouble(substringel(x,1:strsplit(n<-logc(x,10)+1""),1:n"")))};x}
Fails at N=45 because R insists on writing 10.000 as 1e+05, which isnt appreciated by as.numeric()
, this is fixable by using as.integer()
at the cost of 12 bytes:
f=function(N){y=x=`if`(N-1,f(N-1),0);while(N!=prod(y)&N!=sum(y)){x=x+1;y=as.numericdouble(substringel(strsplit(c(as.integer(x),1:(n<-log(x,10)+1""),1:n"")))};x}
As a statistical programming language R has annoyingly wordy ways of splitting numbers into a vector of digits. Especially because everything has to be converted back from strings to numerical values explicitly.
12 bytes saved thanks to billywob.