OFFSET
1,2
COMMENTS
All numbers of the form xx1x...x with x x's are terms, as are numbers of the form xxx1x...x with x^x x's, and so on.
If the first two digits of a number are x,y, respectively, and if (x^(y-1))/y is a positive integer, then the number of the form xy1(...), where (...) is a sequence of digits whose product is (x^(y-1))/y, is a term. - Michal Gren, Nov 29 2018
LINKS
Michal Gren, Table of n, a(n) for n = 1..10000
EXAMPLE
6213 is a term since 6^2^1^3 = 6*2*1*3 = 36.
8^4 = 4096. 8*4 = 32. So 841 followed by any sequence of digits whose product is 4096/32 = 128 is in the sequence. - David A. Corneth, Nov 28 2018
MATHEMATICA
aQ[n_] := Module[{digits = IntegerDigits[n]}, If[MemberQ[digits, 0], False, Power@@digits == Times@@digits]]; Select[Range[1000], aQ] (* for small terms, or: *) aQ[n_] := Module[{d=IntegerDigits[n]}, If[MemberQ[d, 0], Return[False]]; p = Times@@d; If[MemberQ[d, 1], If[d[[1]]==1, Return[p==1]]; d = d[[1 ;; FirstPosition[d, 1][[1]]-1]]]; Do[p = Log[d[[i]], p], {i, 1, Length[d]}]; p==1]; Select[Range[1000], aQ] (* Amiram Eldar, Nov 24 2018 *)
PROG
(PARI) a007954(n) = my(d=digits(n)); vecprod(d);
f256229(n, pd)= my(p=1); until(!n\=10, p=(n%10)^p; if (p>pd, return (-p))); p;
isok(k) = my(pd = a007954(k)); pd == f256229(k, pd); \\ Michel Marcus, Nov 25 2018
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Michal Gren, Nov 23 2018
STATUS
approved