Minimal Power Root
Clash Royale CLAN TAG#URR8PPP
up vote
4
down vote
favorite
The minimal power iteration of a number $n$ is defined as follows:
$$textMPI(n):=n^textmin(textdigits(n))$$
That is, $n$ raised to the lowest digit in $n$. For example, $textMPI(32)=32^2=1024$ and $textMPI(1234)=1234^1=1234$.
The minimal power root of a number $n$ is defined as the number obtained from repeatedly applying $textMPI$ 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.
code-golf number sequence
add a comment |Â
up vote
4
down vote
favorite
The minimal power iteration of a number $n$ is defined as follows:
$$textMPI(n):=n^textmin(textdigits(n))$$
That is, $n$ raised to the lowest digit in $n$. For example, $textMPI(32)=32^2=1024$ and $textMPI(1234)=1234^1=1234$.
The minimal power root of a number $n$ is defined as the number obtained from repeatedly applying $textMPI$ 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.
code-golf number sequence
add a comment |Â
up vote
4
down vote
favorite
up vote
4
down vote
favorite
The minimal power iteration of a number $n$ is defined as follows:
$$textMPI(n):=n^textmin(textdigits(n))$$
That is, $n$ raised to the lowest digit in $n$. For example, $textMPI(32)=32^2=1024$ and $textMPI(1234)=1234^1=1234$.
The minimal power root of a number $n$ is defined as the number obtained from repeatedly applying $textMPI$ 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.
code-golf number sequence
The minimal power iteration of a number $n$ is defined as follows:
$$textMPI(n):=n^textmin(textdigits(n))$$
That is, $n$ raised to the lowest digit in $n$. For example, $textMPI(32)=32^2=1024$ and $textMPI(1234)=1234^1=1234$.
The minimal power root of a number $n$ is defined as the number obtained from repeatedly applying $textMPI$ 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.
code-golf number sequence
code-golf number sequence
edited 45 mins ago
asked 58 mins ago
Conor O'Brien
28.5k263158
28.5k263158
add a comment |Â
add a comment |Â
5 Answers
5
active
oldest
votes
up vote
0
down vote
Jelly, 14 bytes
3*Dá¹Â$$ÃÂLá¸Â1,$ÃÂ#
Try it online!
add a comment |Â
up vote
0
down vote
Mathematica, 59 bytes
Select[Range@#,1<FixedPoint[#^Min@IntegerDigits@#&,#]!=#&]&
Pure function. Takes a number as input, and returns the list of terms up to that number as output. Nothing very complicated here.
add a comment |Â
up vote
0
down vote
Pyth, 10 bytes
.f>u^GshS`
Try it online!
This generates a list of the first $ n $ such numbers. The auto-filled program has GZZQ
as a suffix. This simply finds (.f
) the first Q
numbers that have a minimal power root u^GshS`G
greater than itself Z
.
The minimal power root code works by finding a fixed point u
of raising the current number G
to the power of it's minimal digit, which is the same as the first digit (h
) sorted lexicographically (S
), then converted back to an integer (s
).
add a comment |Â
up vote
0
down vote
Perl 6, 24 bytes
$_,$_**.comb.min...*
Try it online!
Returns an infinite sequence.
add a comment |Â
up vote
0
down vote
Jelly, 10 bytes
*Dá¹ÂÃÂìá¸ÂCæõ#
Try it online!
How?
Counts up starting a n=1
until input
truthy results of a monadic function are encountered and yields those n
s.
The function repeatedly applies another monadic function starting with x=n
and collects the values of x
until the results are no longer unique. (e.g.: 19
yields [19]
; 23
yields [23,529,279841]
; 24
yields [24, 576, 63403380965376, 1]; etc...) and then dequeues the result (removes the leftmost value), complements all the values (1-x
) and uses æ
to yield 0
when there is a zero in the list or if it's empty.
The innermost function raises the current x
to all the digits of x
and then keeps the minimum (doing this is a byte save over finding the minimum digit first).
*Dá¹ÂÃÂìá¸ÂCæõ# - Main Link (call the input number I)
# - count up from 1 and yield the first I for which this yields a truthy value:
õ - a monadic chain:
ì - collect until results are not unique:
ÃÂ - last three links as a monad:
D - convert to a list of decimal digits
* - exponentiate
á¹ - minimum
Ḡ- dequeue
C - compliment
æ - any-and-all?
add a comment |Â
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Jelly, 14 bytes
3*Dá¹Â$$ÃÂLá¸Â1,$ÃÂ#
Try it online!
add a comment |Â
up vote
0
down vote
Jelly, 14 bytes
3*Dá¹Â$$ÃÂLá¸Â1,$ÃÂ#
Try it online!
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Jelly, 14 bytes
3*Dá¹Â$$ÃÂLá¸Â1,$ÃÂ#
Try it online!
Jelly, 14 bytes
3*Dá¹Â$$ÃÂLá¸Â1,$ÃÂ#
Try it online!
answered 43 mins ago
Erik the Outgolfer
29.8k42899
29.8k42899
add a comment |Â
add a comment |Â
up vote
0
down vote
Mathematica, 59 bytes
Select[Range@#,1<FixedPoint[#^Min@IntegerDigits@#&,#]!=#&]&
Pure function. Takes a number as input, and returns the list of terms up to that number as output. Nothing very complicated here.
add a comment |Â
up vote
0
down vote
Mathematica, 59 bytes
Select[Range@#,1<FixedPoint[#^Min@IntegerDigits@#&,#]!=#&]&
Pure function. Takes a number as input, and returns the list of terms up to that number as output. Nothing very complicated here.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Mathematica, 59 bytes
Select[Range@#,1<FixedPoint[#^Min@IntegerDigits@#&,#]!=#&]&
Pure function. Takes a number as input, and returns the list of terms up to that number as output. Nothing very complicated here.
Mathematica, 59 bytes
Select[Range@#,1<FixedPoint[#^Min@IntegerDigits@#&,#]!=#&]&
Pure function. Takes a number as input, and returns the list of terms up to that number as output. Nothing very complicated here.
answered 35 mins ago
LegionMammal978
14.8k41752
14.8k41752
add a comment |Â
add a comment |Â
up vote
0
down vote
Pyth, 10 bytes
.f>u^GshS`
Try it online!
This generates a list of the first $ n $ such numbers. The auto-filled program has GZZQ
as a suffix. This simply finds (.f
) the first Q
numbers that have a minimal power root u^GshS`G
greater than itself Z
.
The minimal power root code works by finding a fixed point u
of raising the current number G
to the power of it's minimal digit, which is the same as the first digit (h
) sorted lexicographically (S
), then converted back to an integer (s
).
add a comment |Â
up vote
0
down vote
Pyth, 10 bytes
.f>u^GshS`
Try it online!
This generates a list of the first $ n $ such numbers. The auto-filled program has GZZQ
as a suffix. This simply finds (.f
) the first Q
numbers that have a minimal power root u^GshS`G
greater than itself Z
.
The minimal power root code works by finding a fixed point u
of raising the current number G
to the power of it's minimal digit, which is the same as the first digit (h
) sorted lexicographically (S
), then converted back to an integer (s
).
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Pyth, 10 bytes
.f>u^GshS`
Try it online!
This generates a list of the first $ n $ such numbers. The auto-filled program has GZZQ
as a suffix. This simply finds (.f
) the first Q
numbers that have a minimal power root u^GshS`G
greater than itself Z
.
The minimal power root code works by finding a fixed point u
of raising the current number G
to the power of it's minimal digit, which is the same as the first digit (h
) sorted lexicographically (S
), then converted back to an integer (s
).
Pyth, 10 bytes
.f>u^GshS`
Try it online!
This generates a list of the first $ n $ such numbers. The auto-filled program has GZZQ
as a suffix. This simply finds (.f
) the first Q
numbers that have a minimal power root u^GshS`G
greater than itself Z
.
The minimal power root code works by finding a fixed point u
of raising the current number G
to the power of it's minimal digit, which is the same as the first digit (h
) sorted lexicographically (S
), then converted back to an integer (s
).
answered 28 mins ago
FryAmTheEggman
14.6k32481
14.6k32481
add a comment |Â
add a comment |Â
up vote
0
down vote
Perl 6, 24 bytes
$_,$_**.comb.min...*
Try it online!
Returns an infinite sequence.
add a comment |Â
up vote
0
down vote
Perl 6, 24 bytes
$_,$_**.comb.min...*
Try it online!
Returns an infinite sequence.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Perl 6, 24 bytes
$_,$_**.comb.min...*
Try it online!
Returns an infinite sequence.
Perl 6, 24 bytes
$_,$_**.comb.min...*
Try it online!
Returns an infinite sequence.
answered 22 mins ago
nwellnhof
4,388817
4,388817
add a comment |Â
add a comment |Â
up vote
0
down vote
Jelly, 10 bytes
*Dá¹ÂÃÂìá¸ÂCæõ#
Try it online!
How?
Counts up starting a n=1
until input
truthy results of a monadic function are encountered and yields those n
s.
The function repeatedly applies another monadic function starting with x=n
and collects the values of x
until the results are no longer unique. (e.g.: 19
yields [19]
; 23
yields [23,529,279841]
; 24
yields [24, 576, 63403380965376, 1]; etc...) and then dequeues the result (removes the leftmost value), complements all the values (1-x
) and uses æ
to yield 0
when there is a zero in the list or if it's empty.
The innermost function raises the current x
to all the digits of x
and then keeps the minimum (doing this is a byte save over finding the minimum digit first).
*Dá¹ÂÃÂìá¸ÂCæõ# - Main Link (call the input number I)
# - count up from 1 and yield the first I for which this yields a truthy value:
õ - a monadic chain:
ì - collect until results are not unique:
ÃÂ - last three links as a monad:
D - convert to a list of decimal digits
* - exponentiate
á¹ - minimum
Ḡ- dequeue
C - compliment
æ - any-and-all?
add a comment |Â
up vote
0
down vote
Jelly, 10 bytes
*Dá¹ÂÃÂìá¸ÂCæõ#
Try it online!
How?
Counts up starting a n=1
until input
truthy results of a monadic function are encountered and yields those n
s.
The function repeatedly applies another monadic function starting with x=n
and collects the values of x
until the results are no longer unique. (e.g.: 19
yields [19]
; 23
yields [23,529,279841]
; 24
yields [24, 576, 63403380965376, 1]; etc...) and then dequeues the result (removes the leftmost value), complements all the values (1-x
) and uses æ
to yield 0
when there is a zero in the list or if it's empty.
The innermost function raises the current x
to all the digits of x
and then keeps the minimum (doing this is a byte save over finding the minimum digit first).
*Dá¹ÂÃÂìá¸ÂCæõ# - Main Link (call the input number I)
# - count up from 1 and yield the first I for which this yields a truthy value:
õ - a monadic chain:
ì - collect until results are not unique:
ÃÂ - last three links as a monad:
D - convert to a list of decimal digits
* - exponentiate
á¹ - minimum
Ḡ- dequeue
C - compliment
æ - any-and-all?
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Jelly, 10 bytes
*Dá¹ÂÃÂìá¸ÂCæõ#
Try it online!
How?
Counts up starting a n=1
until input
truthy results of a monadic function are encountered and yields those n
s.
The function repeatedly applies another monadic function starting with x=n
and collects the values of x
until the results are no longer unique. (e.g.: 19
yields [19]
; 23
yields [23,529,279841]
; 24
yields [24, 576, 63403380965376, 1]; etc...) and then dequeues the result (removes the leftmost value), complements all the values (1-x
) and uses æ
to yield 0
when there is a zero in the list or if it's empty.
The innermost function raises the current x
to all the digits of x
and then keeps the minimum (doing this is a byte save over finding the minimum digit first).
*Dá¹ÂÃÂìá¸ÂCæõ# - Main Link (call the input number I)
# - count up from 1 and yield the first I for which this yields a truthy value:
õ - a monadic chain:
ì - collect until results are not unique:
ÃÂ - last three links as a monad:
D - convert to a list of decimal digits
* - exponentiate
á¹ - minimum
Ḡ- dequeue
C - compliment
æ - any-and-all?
Jelly, 10 bytes
*Dá¹ÂÃÂìá¸ÂCæõ#
Try it online!
How?
Counts up starting a n=1
until input
truthy results of a monadic function are encountered and yields those n
s.
The function repeatedly applies another monadic function starting with x=n
and collects the values of x
until the results are no longer unique. (e.g.: 19
yields [19]
; 23
yields [23,529,279841]
; 24
yields [24, 576, 63403380965376, 1]; etc...) and then dequeues the result (removes the leftmost value), complements all the values (1-x
) and uses æ
to yield 0
when there is a zero in the list or if it's empty.
The innermost function raises the current x
to all the digits of x
and then keeps the minimum (doing this is a byte save over finding the minimum digit first).
*Dá¹ÂÃÂìá¸ÂCæõ# - Main Link (call the input number I)
# - count up from 1 and yield the first I for which this yields a truthy value:
õ - a monadic chain:
ì - collect until results are not unique:
ÃÂ - last three links as a monad:
D - convert to a list of decimal digits
* - exponentiate
á¹ - minimum
Ḡ- dequeue
C - compliment
æ - any-and-all?
edited 6 mins ago
answered 33 mins ago
Jonathan Allan
49k534161
49k534161
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f174007%2fminimal-power-root%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password