24
The minimal power iteration of a number \$n\$ is defined as follows:
$$\text{MPI}(n):=n^{\text{min}(\text{digits}(n))}$$
That is, \$n\$ raised to the lowest digit in \$n\$. For example, \$\text{MPI}(32)=32^2=1024\$ and \$\text{MPI}(1234)=1234^1=1234\$.
The minimal power root of a number \$n\$ is defined as the number obtained from repeatedly applying \$\text{MPI}\$ until a fixed point is found. Here is a table of the minimal power roots of numbers between 1 and 25:
n MPR(n)
--------------------------
1 1
2 1
3 531441
4 1
5 3125
6 4738381338321616896
7 1
8 16777216
9 1
10 1
11 11
12 12
13 13
14 14
15 15
16 16
17 17
18 18
19 19
20 1
21 21
22 1
23 279841
24 1
25 1
Challenge: Generate the numbers whose minimal power root is not equal to 1 or itself.
Here are the first 50 numbers in this sequence:
3, 5, 6, 8, 23, 26, 27, 29, 35, 36, 39, 42, 47, 53, 59, 64, 72, 76, 78, 82, 83, 84, 92, 222, 223, 227, 228, 229, 233, 237, 239, 254, 263, 267, 268, 269, 273, 276, 277, 278, 279, 285, 286, 287, 289, 296, 335, 338, 339, 342
Rules
- You may generate the first
n
numbers of this sequence (0- or 1-indexed), generate then
th term, create a generator which calculates these terms, output infinitely many of them, etc. - You may take input and give output in any base, but the calculations for MPR must be in base 10. E.g., you may take input
###
(in unary) and output### ##### ######
(in unary) - You must yield numbers. You may not (e.g.) output
"3", "5", "6"
, since those are strings.3, 5, 6
and3 5 6
are both valid, however. Outputting2 3
,"23"
, ortwenty-three
are all considered invalid representations of the number23
. (Again, you may use any base to represent these numbers.) - This is a code-golf, so the shortest code (in bytes) wins.
2Just curious, how could you prove that a fixed point is found eventually for all n? – nwellnhof – 2018-10-14T22:23:06.777
1@nwellnhof (Rough proof.) Suppose there is no fixed point of $x$, i.e., $\text{MPR}(x)$ doesn't exist. Let $x_i$ be the $i$-th iteration of the $\text{MPI}$ function over $x$. This sequence is strictly increasing, since $a^b>a^{b^c}$ for all $a,b,c\ge2$. Being strictly increasing, the probability of no digit in $x_i$ being 0 or 1 tends towards 0 as $x_i$ tends towards $\infty$. – Conor O'Brien – 2018-10-14T22:39:11.860
Huh. The oeis doesn't have this sequence. – Draco18s no longer trusts SE – 2018-10-15T00:09:19.183
1@ConorO'Brien That shows your hypothesis is plausible, but it doesn't prove it. – kasperd – 2018-10-15T15:37:15.193
1@kasperd Thus the "rough proof" before it. – Conor O'Brien – 2018-10-15T20:13:28.500
I don't understand this challenge. What is the actual goal that determines the result? It's the minimum power of n that fulfils... what condition? – Fabian Röling – 2018-10-16T08:37:48.193
@FabianRöling The challenge is to find what
n
eventually results in after applying $\text{MPI}$. E.g., for23
, you perform MPI, givingMPI(23) = 23^min(digits(23)) = 23^min(2, 3) = 23^2 = 529
. This is the first iteration. Again,MPI(529) = 529^min(5, 2, 9) = 529^2 = 279841
. This is the second iteration. Once more,MPI(279841) = 279841^min(2,7,9,8,4,1) = 279841^1 = 279841
. Here,MPI(279841) = 279841
, and we cannot go any further without repeating the results. Thus,MPR(23) = 279841
. We are looking for numbersn
such thatMPR(n) != 1 && MPR(n) != n
. – Conor O'Brien – 2018-10-16T15:26:56.800Oh, you take the lowest digit as the power, got it. And if it's 0? Then you get to number^0=1, 1^1=1, fixed point or what? – Fabian Röling – 2018-10-16T17:18:17.210
@FabianRöling yes – Conor O'Brien – 2018-10-16T19:34:20.920
Is it OK if we omit numbers whose MPRs do not fit inside the range of numbers supported in our language? For example, the MPR of 335 is outside of the bounds of the largest integer type in my language. – S.S. Anne – 2020-02-04T12:32:28.790