A282782 Numbers that are equal to a product of powers of digits where the exponents from left to right decrease with 1 and the exponent for the units digit is 1.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1715
Offset: 1
Examples
1 = 1^1, 2 = 2^1, ..., 1715 = (1^4)*(7^3)*(1^2)*(5^1). These numbers do not match the rule: 46: (4^2)*(6^1) = 96 <> 46. 234: (2^3)*(3^2)*(4^1) = 288 <> 234. 4342: (4^4)*(3^3)*(4^2)*(2^1) = 221184 <> 4342. 46914: (4^5)*(6^4)*(9^3)*(1^2)*(4^1) = 3869835264 <> 46914.
Programs
-
Mathematica
mx = 10^50; test[n_] := n == Times @@ (IntegerDigits[n] ^Reverse[Range@ IntegerLength@ n]); Union@Reap[Do[n = 2^i 3^j 7^k; If[test@n, Sow@n], {i, 0, Log2[mx]}, {j, 0, Log[3, mx/2^i]}, {k, 0, Log[7, mx/2^i/3^j]}]; Do[n = 5 3^j 7^k; If[test@n, Sow@n], {j, 0, Log[3, mx/5]}, {k, 0, Log[7, mx/ 5/ 3^j]}]][[2, 1]] (* Search up to 10^50, Giovanni Resta, Feb 22 2017 *) Select[Range[0, 2000], Times @@ MapIndexed[#1^First[#2] &, Reverse@ IntegerDigits@ #] == # &] (* Michael De Vlieger, Feb 22 2017 *)
-
PARI
is(n)=my(d=digits(n)); prod(i=1,#d,d[#d+1-i]^i)==n || !n \\ Charles R Greathouse IV, Feb 22 2017
-
PARI
list(lim)=my(v=List([0]),t7,t37,t); for(a=0,logint(lim\1,7), t7=7^a; for(b=0,logint(lim\t7,3), t=t37=t7*3^b; while(t<=lim, if(is(t), listput(v,t)); t<<=1); t=t37; while(t<=lim, if(is(t), listput(v,t)); t*=5))); Set(v) \\ Charles R Greathouse IV, Feb 22 2017
-
VBA
' For example for 5-figure numbers: Dim zahl As String For i = 10000 To 99999 zahl = i If i = CInt(Left(zahl, 1)) ^ 5 * CInt(Right(Left(zahl, 2), 1)) ^ 4 * CInt(Right(Left(zahl, 3), 1)) ^ 3 * CInt(Right(Left(zahl, 4), 1)) ^ 2 * CInt(Right(zahl, 1)) ^ 1 Then MsgBox (i) End If Next i
Extensions
Leading 0 prepended by David A. Corneth, Feb 22 2017
Comments