To exponential digit growth and beyond!Hereditary Base ChangeOutput the juggler sequenceExcludivisible numbersHead, Shoulders, Knees and Toes, Knees and ToesMix pi and e to make pie!Create a pointer sequenceOlympic Rings SequenceDecimal Digit TruncatingPatience, young “Padovan”Convert a number into “bracket” numerals
Does the "6 seconds per round" rule apply to speaking/roleplaying during combat situations?
How were concentration and extermination camp guards recruited?
Smooth switching between 12v batteries, with toggle switch
What is in `tex.print` or `tex.sprint`?
Accidentally renamed tar.gz file to a non tar.gz file, will my file be messed up
What are the words for people who cause trouble believing they know better?
Avoiding cliches when writing gods
Importance sampling estimation of power function
Why does the Schrödinger equation work so well for the Hydrogen atom despite the relativistic boundary at the nucleus?
Why don't B747s start takeoffs with full throttle?
Does the first version of Linux developed by Linus Torvalds have a GUI?
What can plausibly explain many of my very long and low-tech bridges?
How can drunken, homicidal elves successfully conduct a wild hunt?
Completing the square to find if quadratic form is positive definite.
How to pass a regex when finding a directory path in bash?
Why is quantum entanglement surprising?
Reading two lines in piano
How is it possible that Gollum speaks Westron?
What is the advantage of carrying a tripod and ND-filters when you could use image stacking instead?
What's the correct term describing the action of sending a brand-new ship out into its first seafaring trip?
PC video game involving floating islands doing aerial combat
Are there cubesats in GEO?
Implement Homestuck's Catenative Doomsday Dice Cascader
What happened to all the nuclear material being smuggled after the fall of the USSR?
To exponential digit growth and beyond!
Hereditary Base ChangeOutput the juggler sequenceExcludivisible numbersHead, Shoulders, Knees and Toes, Knees and ToesMix pi and e to make pie!Create a pointer sequenceOlympic Rings SequenceDecimal Digit TruncatingPatience, young “Padovan”Convert a number into “bracket” numerals
$begingroup$
Challenge
Given a base $1 < b < 10$ and an index $t ge 1$, output term $x_t$, defined as follows:
- $x_1 = 11_10$
$x_i+1$ is obtained by converting $x_i$ to base $b$ and then reinterpreting its digits in base $10$- Output should be in base $10$
A walk through for base 5, term 5 would be:
$x_1 = 11_10$.
$11_10 = 21_5$ so $x_2 = 21_10$.
$21_10 = 41_5$ so $x_3 = 41_10$.
$41_10 = 131_5$ so $x_4 = 131_10$.
$131_10 = 1011_5$ so $x_5 = 1011_10$.- We output the string
"1011"
or the integer1011
.
Test Cases
Note: these are one indexed
base 2, term 5 --> 1100100111110011010011100010101000011000101001000100011011011010001111011100010000001000010011100011
base 9, term 70 --> 1202167480887
base 8, term 30 --> 4752456545
base 4, term 13 --> 2123103032103331200023103133211223233322200311320011300320320100312133201303003031113021311200322222332322220300332231220022313031200030333132302313012110123012123010113230200132021023101313232010013102221103203031121232122020233303303303211132313213012222331020133
Notes
- Standard loopholes are not allowed
- Any default I/O method is allowed
- You may use different indexes (such as 0-indexed, 1-indexed, 2-indexed, etc) for $t$
- You may output the first $t$ terms.
- As this is code-golf, shortest code wins for that language
code-golf number
$endgroup$
|
show 1 more comment
$begingroup$
Challenge
Given a base $1 < b < 10$ and an index $t ge 1$, output term $x_t$, defined as follows:
- $x_1 = 11_10$
$x_i+1$ is obtained by converting $x_i$ to base $b$ and then reinterpreting its digits in base $10$- Output should be in base $10$
A walk through for base 5, term 5 would be:
$x_1 = 11_10$.
$11_10 = 21_5$ so $x_2 = 21_10$.
$21_10 = 41_5$ so $x_3 = 41_10$.
$41_10 = 131_5$ so $x_4 = 131_10$.
$131_10 = 1011_5$ so $x_5 = 1011_10$.- We output the string
"1011"
or the integer1011
.
Test Cases
Note: these are one indexed
base 2, term 5 --> 1100100111110011010011100010101000011000101001000100011011011010001111011100010000001000010011100011
base 9, term 70 --> 1202167480887
base 8, term 30 --> 4752456545
base 4, term 13 --> 2123103032103331200023103133211223233322200311320011300320320100312133201303003031113021311200322222332322220300332231220022313031200030333132302313012110123012123010113230200132021023101313232010013102221103203031121232122020233303303303211132313213012222331020133
Notes
- Standard loopholes are not allowed
- Any default I/O method is allowed
- You may use different indexes (such as 0-indexed, 1-indexed, 2-indexed, etc) for $t$
- You may output the first $t$ terms.
- As this is code-golf, shortest code wins for that language
code-golf number
$endgroup$
1
$begingroup$
Do we have to support larger numbers or just numbers up to 2^31 - 1?
$endgroup$
– Embodiment of Ignorance
May 19 at 23:39
1
$begingroup$
@EmbodimentofIgnorance The maximum of your language (Remember the standard loophole, though!)
$endgroup$
– MilkyWay90
May 19 at 23:43
$begingroup$
Is there a challenge that includes bases > 10? (In that case you would repeatedly interpret11
as if it was in baseb
and convert it back to base 10, etc.)
$endgroup$
– Neil
May 21 at 11:11
$begingroup$
@Neil I didn't include bases higher than 10 since (for example)4a
wouldn't be a valid number in base-10
$endgroup$
– MilkyWay90
May 22 at 22:49
$begingroup$
You wouldn't get4a
, since you'd be interpreting the base 10 digits as baseb
and converting to base 10 each time (i.e. the other way around from this question).
$endgroup$
– Neil
May 22 at 22:59
|
show 1 more comment
$begingroup$
Challenge
Given a base $1 < b < 10$ and an index $t ge 1$, output term $x_t$, defined as follows:
- $x_1 = 11_10$
$x_i+1$ is obtained by converting $x_i$ to base $b$ and then reinterpreting its digits in base $10$- Output should be in base $10$
A walk through for base 5, term 5 would be:
$x_1 = 11_10$.
$11_10 = 21_5$ so $x_2 = 21_10$.
$21_10 = 41_5$ so $x_3 = 41_10$.
$41_10 = 131_5$ so $x_4 = 131_10$.
$131_10 = 1011_5$ so $x_5 = 1011_10$.- We output the string
"1011"
or the integer1011
.
Test Cases
Note: these are one indexed
base 2, term 5 --> 1100100111110011010011100010101000011000101001000100011011011010001111011100010000001000010011100011
base 9, term 70 --> 1202167480887
base 8, term 30 --> 4752456545
base 4, term 13 --> 2123103032103331200023103133211223233322200311320011300320320100312133201303003031113021311200322222332322220300332231220022313031200030333132302313012110123012123010113230200132021023101313232010013102221103203031121232122020233303303303211132313213012222331020133
Notes
- Standard loopholes are not allowed
- Any default I/O method is allowed
- You may use different indexes (such as 0-indexed, 1-indexed, 2-indexed, etc) for $t$
- You may output the first $t$ terms.
- As this is code-golf, shortest code wins for that language
code-golf number
$endgroup$
Challenge
Given a base $1 < b < 10$ and an index $t ge 1$, output term $x_t$, defined as follows:
- $x_1 = 11_10$
$x_i+1$ is obtained by converting $x_i$ to base $b$ and then reinterpreting its digits in base $10$- Output should be in base $10$
A walk through for base 5, term 5 would be:
$x_1 = 11_10$.
$11_10 = 21_5$ so $x_2 = 21_10$.
$21_10 = 41_5$ so $x_3 = 41_10$.
$41_10 = 131_5$ so $x_4 = 131_10$.
$131_10 = 1011_5$ so $x_5 = 1011_10$.- We output the string
"1011"
or the integer1011
.
Test Cases
Note: these are one indexed
base 2, term 5 --> 1100100111110011010011100010101000011000101001000100011011011010001111011100010000001000010011100011
base 9, term 70 --> 1202167480887
base 8, term 30 --> 4752456545
base 4, term 13 --> 2123103032103331200023103133211223233322200311320011300320320100312133201303003031113021311200322222332322220300332231220022313031200030333132302313012110123012123010113230200132021023101313232010013102221103203031121232122020233303303303211132313213012222331020133
Notes
- Standard loopholes are not allowed
- Any default I/O method is allowed
- You may use different indexes (such as 0-indexed, 1-indexed, 2-indexed, etc) for $t$
- You may output the first $t$ terms.
- As this is code-golf, shortest code wins for that language
code-golf number
code-golf number
edited May 19 at 23:42
MilkyWay90
asked May 19 at 23:13
MilkyWay90MilkyWay90
955322
955322
1
$begingroup$
Do we have to support larger numbers or just numbers up to 2^31 - 1?
$endgroup$
– Embodiment of Ignorance
May 19 at 23:39
1
$begingroup$
@EmbodimentofIgnorance The maximum of your language (Remember the standard loophole, though!)
$endgroup$
– MilkyWay90
May 19 at 23:43
$begingroup$
Is there a challenge that includes bases > 10? (In that case you would repeatedly interpret11
as if it was in baseb
and convert it back to base 10, etc.)
$endgroup$
– Neil
May 21 at 11:11
$begingroup$
@Neil I didn't include bases higher than 10 since (for example)4a
wouldn't be a valid number in base-10
$endgroup$
– MilkyWay90
May 22 at 22:49
$begingroup$
You wouldn't get4a
, since you'd be interpreting the base 10 digits as baseb
and converting to base 10 each time (i.e. the other way around from this question).
$endgroup$
– Neil
May 22 at 22:59
|
show 1 more comment
1
$begingroup$
Do we have to support larger numbers or just numbers up to 2^31 - 1?
$endgroup$
– Embodiment of Ignorance
May 19 at 23:39
1
$begingroup$
@EmbodimentofIgnorance The maximum of your language (Remember the standard loophole, though!)
$endgroup$
– MilkyWay90
May 19 at 23:43
$begingroup$
Is there a challenge that includes bases > 10? (In that case you would repeatedly interpret11
as if it was in baseb
and convert it back to base 10, etc.)
$endgroup$
– Neil
May 21 at 11:11
$begingroup$
@Neil I didn't include bases higher than 10 since (for example)4a
wouldn't be a valid number in base-10
$endgroup$
– MilkyWay90
May 22 at 22:49
$begingroup$
You wouldn't get4a
, since you'd be interpreting the base 10 digits as baseb
and converting to base 10 each time (i.e. the other way around from this question).
$endgroup$
– Neil
May 22 at 22:59
1
1
$begingroup$
Do we have to support larger numbers or just numbers up to 2^31 - 1?
$endgroup$
– Embodiment of Ignorance
May 19 at 23:39
$begingroup$
Do we have to support larger numbers or just numbers up to 2^31 - 1?
$endgroup$
– Embodiment of Ignorance
May 19 at 23:39
1
1
$begingroup$
@EmbodimentofIgnorance The maximum of your language (Remember the standard loophole, though!)
$endgroup$
– MilkyWay90
May 19 at 23:43
$begingroup$
@EmbodimentofIgnorance The maximum of your language (Remember the standard loophole, though!)
$endgroup$
– MilkyWay90
May 19 at 23:43
$begingroup$
Is there a challenge that includes bases > 10? (In that case you would repeatedly interpret
11
as if it was in base b
and convert it back to base 10, etc.)$endgroup$
– Neil
May 21 at 11:11
$begingroup$
Is there a challenge that includes bases > 10? (In that case you would repeatedly interpret
11
as if it was in base b
and convert it back to base 10, etc.)$endgroup$
– Neil
May 21 at 11:11
$begingroup$
@Neil I didn't include bases higher than 10 since (for example)
4a
wouldn't be a valid number in base-10$endgroup$
– MilkyWay90
May 22 at 22:49
$begingroup$
@Neil I didn't include bases higher than 10 since (for example)
4a
wouldn't be a valid number in base-10$endgroup$
– MilkyWay90
May 22 at 22:49
$begingroup$
You wouldn't get
4a
, since you'd be interpreting the base 10 digits as base b
and converting to base 10 each time (i.e. the other way around from this question).$endgroup$
– Neil
May 22 at 22:59
$begingroup$
You wouldn't get
4a
, since you'd be interpreting the base 10 digits as base b
and converting to base 10 each time (i.e. the other way around from this question).$endgroup$
– Neil
May 22 at 22:59
|
show 1 more comment
22 Answers
22
active
oldest
votes
$begingroup$
JavaScript (Node.js), 40 bytes
Thanks to @Neil for saving 5 bytes on this version and 2 bytes on the BigInt version
Takes input as (t)(base)
, where $t$ is 1-indexed.
n=>g=(b,x=11)=>--n?g(b,+x.toString(b)):x
Try it online!
JavaScript (Node.js), 48 bytes (BigInt version)
Takes input as (t)(base)
, where $t$ is 1-indexed. Returns a BigInt.
n=>g=(b,x=11n)=>--n?g(b,BigInt(x.toString(b))):x
Try it online!
$endgroup$
$begingroup$
Do you need toeval
in the first version?+
would save 5 bytes...
$endgroup$
– Neil
May 20 at 0:36
$begingroup$
AndBigInt
saves two bytes in the second version, because you don't need to addn
to the string.
$endgroup$
– Neil
May 20 at 0:37
$begingroup$
(b,t,x=11)=>--t?f(b,t,+x.toString(b)):x
is 1 char shorter
$endgroup$
– Qwertiy
May 25 at 21:45
$begingroup$
@Qwertiy It's actually 1 byte longer, because we'd need to prependf=
(since the function is referencing itself).
$endgroup$
– Arnauld
May 25 at 22:04
$begingroup$
@Arnauld, oops. Then this onen=>b=>g=(x=11n)=>--n?g(BigInt(x.toString(b))):x
:) If callf(t)(b)()
is allowed.
$endgroup$
– Qwertiy
May 25 at 22:07
|
show 1 more comment
$begingroup$
05AB1E, 5 bytes
>IF¹B
Try it online!
Explanation
> # increment <base>
IF # <term> times do:
¹B # convert from base-10 to base-<base>
Note that there is no need to explicitly start the sequence at 11.
Starting at base+1
and doing an extra iteration will result in the first iteration giving 11.
$endgroup$
add a comment |
$begingroup$
Japt, 9 bytes
ÆB=sV n
B
Try it
(Two inputs, U and V)
Æ Range [0..U)
B= For each, set B (B is preinitialized to 11) to
sV B's previous value converted to base-V
n and back to base-10
B Print out B's final value
$endgroup$
$begingroup$
This will never be able to output the first term, will it?
$endgroup$
– Shaggy
May 20 at 7:14
$begingroup$
@Shaggy Fixed at the cost of two bytes
$endgroup$
– Embodiment of Ignorance
May 20 at 21:57
$begingroup$
Nicely saved :) Wouldn't have thought of doing that meself.
$endgroup$
– Shaggy
May 21 at 22:25
add a comment |
$begingroup$
Wolfram Language (Mathematica), 46 bytes
bNest[FromDigits[#~IntegerDigits~b]&,11,#]&
Try it online!
Call with f[base][t]
. 0-indexed.
$endgroup$
1
$begingroup$
41 bytes
$endgroup$
– Expired Data
May 20 at 8:37
add a comment |
$begingroup$
Retina, 67 bytes
.+,(d+)
11,$1*
"$+" helper function: convert to Base b (implicit) then convert to base 10
{
Try it online!
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "200"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f185816%2fto-exponential-digit-growth-and-beyond%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
22 Answers
22
active
oldest
votes
22 Answers
22
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
JavaScript (Node.js), 40 bytes
Thanks to @Neil for saving 5 bytes on this version and 2 bytes on the BigInt version
Takes input as (t)(base)
, where $t$ is 1-indexed.
n=>g=(b,x=11)=>--n?g(b,+x.toString(b)):x
Try it online!
JavaScript (Node.js), 48 bytes (BigInt version)
Takes input as (t)(base)
, where $t$ is 1-indexed. Returns a BigInt.
n=>g=(b,x=11n)=>--n?g(b,BigInt(x.toString(b))):x
Try it online!
$endgroup$
$begingroup$
Do you need toeval
in the first version?+
would save 5 bytes...
$endgroup$
– Neil
May 20 at 0:36
$begingroup$
AndBigInt
saves two bytes in the second version, because you don't need to addn
to the string.
$endgroup$
– Neil
May 20 at 0:37
$begingroup$
(b,t,x=11)=>--t?f(b,t,+x.toString(b)):x
is 1 char shorter
$endgroup$
– Qwertiy
May 25 at 21:45
$begingroup$
@Qwertiy It's actually 1 byte longer, because we'd need to prependf=
(since the function is referencing itself).
$endgroup$
– Arnauld
May 25 at 22:04
$begingroup$
@Arnauld, oops. Then this onen=>b=>g=(x=11n)=>--n?g(BigInt(x.toString(b))):x
:) If callf(t)(b)()
is allowed.
$endgroup$
– Qwertiy
May 25 at 22:07
|
show 1 more comment
$begingroup$
JavaScript (Node.js), 40 bytes
Thanks to @Neil for saving 5 bytes on this version and 2 bytes on the BigInt version
Takes input as (t)(base)
, where $t$ is 1-indexed.
n=>g=(b,x=11)=>--n?g(b,+x.toString(b)):x
Try it online!
JavaScript (Node.js), 48 bytes (BigInt version)
Takes input as (t)(base)
, where $t$ is 1-indexed. Returns a BigInt.
n=>g=(b,x=11n)=>--n?g(b,BigInt(x.toString(b))):x
Try it online!
$endgroup$
$begingroup$
Do you need toeval
in the first version?+
would save 5 bytes...
$endgroup$
– Neil
May 20 at 0:36
$begingroup$
AndBigInt
saves two bytes in the second version, because you don't need to addn
to the string.
$endgroup$
– Neil
May 20 at 0:37
$begingroup$
(b,t,x=11)=>--t?f(b,t,+x.toString(b)):x
is 1 char shorter
$endgroup$
– Qwertiy
May 25 at 21:45
$begingroup$
@Qwertiy It's actually 1 byte longer, because we'd need to prependf=
(since the function is referencing itself).
$endgroup$
– Arnauld
May 25 at 22:04
$begingroup$
@Arnauld, oops. Then this onen=>b=>g=(x=11n)=>--n?g(BigInt(x.toString(b))):x
:) If callf(t)(b)()
is allowed.
$endgroup$
– Qwertiy
May 25 at 22:07
|
show 1 more comment
$begingroup$
JavaScript (Node.js), 40 bytes
Thanks to @Neil for saving 5 bytes on this version and 2 bytes on the BigInt version
Takes input as (t)(base)
, where $t$ is 1-indexed.
n=>g=(b,x=11)=>--n?g(b,+x.toString(b)):x
Try it online!
JavaScript (Node.js), 48 bytes (BigInt version)
Takes input as (t)(base)
, where $t$ is 1-indexed. Returns a BigInt.
n=>g=(b,x=11n)=>--n?g(b,BigInt(x.toString(b))):x
Try it online!
$endgroup$
JavaScript (Node.js), 40 bytes
Thanks to @Neil for saving 5 bytes on this version and 2 bytes on the BigInt version
Takes input as (t)(base)
, where $t$ is 1-indexed.
n=>g=(b,x=11)=>--n?g(b,+x.toString(b)):x
Try it online!
JavaScript (Node.js), 48 bytes (BigInt version)
Takes input as (t)(base)
, where $t$ is 1-indexed. Returns a BigInt.
n=>g=(b,x=11n)=>--n?g(b,BigInt(x.toString(b))):x
Try it online!
edited May 20 at 11:34
answered May 19 at 23:25
ArnauldArnauld
85.2k7100349
85.2k7100349
$begingroup$
Do you need toeval
in the first version?+
would save 5 bytes...
$endgroup$
– Neil
May 20 at 0:36
$begingroup$
AndBigInt
saves two bytes in the second version, because you don't need to addn
to the string.
$endgroup$
– Neil
May 20 at 0:37
$begingroup$
(b,t,x=11)=>--t?f(b,t,+x.toString(b)):x
is 1 char shorter
$endgroup$
– Qwertiy
May 25 at 21:45
$begingroup$
@Qwertiy It's actually 1 byte longer, because we'd need to prependf=
(since the function is referencing itself).
$endgroup$
– Arnauld
May 25 at 22:04
$begingroup$
@Arnauld, oops. Then this onen=>b=>g=(x=11n)=>--n?g(BigInt(x.toString(b))):x
:) If callf(t)(b)()
is allowed.
$endgroup$
– Qwertiy
May 25 at 22:07
|
show 1 more comment
$begingroup$
Do you need toeval
in the first version?+
would save 5 bytes...
$endgroup$
– Neil
May 20 at 0:36
$begingroup$
AndBigInt
saves two bytes in the second version, because you don't need to addn
to the string.
$endgroup$
– Neil
May 20 at 0:37
$begingroup$
(b,t,x=11)=>--t?f(b,t,+x.toString(b)):x
is 1 char shorter
$endgroup$
– Qwertiy
May 25 at 21:45
$begingroup$
@Qwertiy It's actually 1 byte longer, because we'd need to prependf=
(since the function is referencing itself).
$endgroup$
– Arnauld
May 25 at 22:04
$begingroup$
@Arnauld, oops. Then this onen=>b=>g=(x=11n)=>--n?g(BigInt(x.toString(b))):x
:) If callf(t)(b)()
is allowed.
$endgroup$
– Qwertiy
May 25 at 22:07
$begingroup$
Do you need to
eval
in the first version? +
would save 5 bytes...$endgroup$
– Neil
May 20 at 0:36
$begingroup$
Do you need to
eval
in the first version? +
would save 5 bytes...$endgroup$
– Neil
May 20 at 0:36
$begingroup$
And
BigInt
saves two bytes in the second version, because you don't need to add n
to the string.$endgroup$
– Neil
May 20 at 0:37
$begingroup$
And
BigInt
saves two bytes in the second version, because you don't need to add n
to the string.$endgroup$
– Neil
May 20 at 0:37
$begingroup$
(b,t,x=11)=>--t?f(b,t,+x.toString(b)):x
is 1 char shorter$endgroup$
– Qwertiy
May 25 at 21:45
$begingroup$
(b,t,x=11)=>--t?f(b,t,+x.toString(b)):x
is 1 char shorter$endgroup$
– Qwertiy
May 25 at 21:45
$begingroup$
@Qwertiy It's actually 1 byte longer, because we'd need to prepend
f=
(since the function is referencing itself).$endgroup$
– Arnauld
May 25 at 22:04
$begingroup$
@Qwertiy It's actually 1 byte longer, because we'd need to prepend
f=
(since the function is referencing itself).$endgroup$
– Arnauld
May 25 at 22:04
$begingroup$
@Arnauld, oops. Then this one
n=>b=>g=(x=11n)=>--n?g(BigInt(x.toString(b))):x
:) If call f(t)(b)()
is allowed.$endgroup$
– Qwertiy
May 25 at 22:07
$begingroup$
@Arnauld, oops. Then this one
n=>b=>g=(x=11n)=>--n?g(BigInt(x.toString(b))):x
:) If call f(t)(b)()
is allowed.$endgroup$
– Qwertiy
May 25 at 22:07
|
show 1 more comment
$begingroup$
05AB1E, 5 bytes
>IF¹B
Try it online!
Explanation
> # increment <base>
IF # <term> times do:
¹B # convert from base-10 to base-<base>
Note that there is no need to explicitly start the sequence at 11.
Starting at base+1
and doing an extra iteration will result in the first iteration giving 11.
$endgroup$
add a comment |
$begingroup$
05AB1E, 5 bytes
>IF¹B
Try it online!
Explanation
> # increment <base>
IF # <term> times do:
¹B # convert from base-10 to base-<base>
Note that there is no need to explicitly start the sequence at 11.
Starting at base+1
and doing an extra iteration will result in the first iteration giving 11.
$endgroup$
add a comment |
$begingroup$
05AB1E, 5 bytes
>IF¹B
Try it online!
Explanation
> # increment <base>
IF # <term> times do:
¹B # convert from base-10 to base-<base>
Note that there is no need to explicitly start the sequence at 11.
Starting at base+1
and doing an extra iteration will result in the first iteration giving 11.
$endgroup$
05AB1E, 5 bytes
>IF¹B
Try it online!
Explanation
> # increment <base>
IF # <term> times do:
¹B # convert from base-10 to base-<base>
Note that there is no need to explicitly start the sequence at 11.
Starting at base+1
and doing an extra iteration will result in the first iteration giving 11.
edited May 20 at 6:26
answered May 20 at 6:15
EmignaEmigna
49.5k534150
49.5k534150
add a comment |
add a comment |
$begingroup$
Japt, 9 bytes
ÆB=sV n
B
Try it
(Two inputs, U and V)
Æ Range [0..U)
B= For each, set B (B is preinitialized to 11) to
sV B's previous value converted to base-V
n and back to base-10
B Print out B's final value
$endgroup$
$begingroup$
This will never be able to output the first term, will it?
$endgroup$
– Shaggy
May 20 at 7:14
$begingroup$
@Shaggy Fixed at the cost of two bytes
$endgroup$
– Embodiment of Ignorance
May 20 at 21:57
$begingroup$
Nicely saved :) Wouldn't have thought of doing that meself.
$endgroup$
– Shaggy
May 21 at 22:25
add a comment |
$begingroup$
Japt, 9 bytes
ÆB=sV n
B
Try it
(Two inputs, U and V)
Æ Range [0..U)
B= For each, set B (B is preinitialized to 11) to
sV B's previous value converted to base-V
n and back to base-10
B Print out B's final value
$endgroup$
$begingroup$
This will never be able to output the first term, will it?
$endgroup$
– Shaggy
May 20 at 7:14
$begingroup$
@Shaggy Fixed at the cost of two bytes
$endgroup$
– Embodiment of Ignorance
May 20 at 21:57
$begingroup$
Nicely saved :) Wouldn't have thought of doing that meself.
$endgroup$
– Shaggy
May 21 at 22:25
add a comment |
$begingroup$
Japt, 9 bytes
ÆB=sV n
B
Try it
(Two inputs, U and V)
Æ Range [0..U)
B= For each, set B (B is preinitialized to 11) to
sV B's previous value converted to base-V
n and back to base-10
B Print out B's final value
$endgroup$
Japt, 9 bytes
ÆB=sV n
B
Try it
(Two inputs, U and V)
Æ Range [0..U)
B= For each, set B (B is preinitialized to 11) to
sV B's previous value converted to base-V
n and back to base-10
B Print out B's final value
edited May 20 at 21:57
answered May 20 at 2:02
Embodiment of IgnoranceEmbodiment of Ignorance
3,874128
3,874128
$begingroup$
This will never be able to output the first term, will it?
$endgroup$
– Shaggy
May 20 at 7:14
$begingroup$
@Shaggy Fixed at the cost of two bytes
$endgroup$
– Embodiment of Ignorance
May 20 at 21:57
$begingroup$
Nicely saved :) Wouldn't have thought of doing that meself.
$endgroup$
– Shaggy
May 21 at 22:25
add a comment |
$begingroup$
This will never be able to output the first term, will it?
$endgroup$
– Shaggy
May 20 at 7:14
$begingroup$
@Shaggy Fixed at the cost of two bytes
$endgroup$
– Embodiment of Ignorance
May 20 at 21:57
$begingroup$
Nicely saved :) Wouldn't have thought of doing that meself.
$endgroup$
– Shaggy
May 21 at 22:25
$begingroup$
This will never be able to output the first term, will it?
$endgroup$
– Shaggy
May 20 at 7:14
$begingroup$
This will never be able to output the first term, will it?
$endgroup$
– Shaggy
May 20 at 7:14
$begingroup$
@Shaggy Fixed at the cost of two bytes
$endgroup$
– Embodiment of Ignorance
May 20 at 21:57
$begingroup$
@Shaggy Fixed at the cost of two bytes
$endgroup$
– Embodiment of Ignorance
May 20 at 21:57
$begingroup$
Nicely saved :) Wouldn't have thought of doing that meself.
$endgroup$
– Shaggy
May 21 at 22:25
$begingroup$
Nicely saved :) Wouldn't have thought of doing that meself.
$endgroup$
– Shaggy
May 21 at 22:25
add a comment |
$begingroup$
Wolfram Language (Mathematica), 46 bytes
bNest[FromDigits[#~IntegerDigits~b]&,11,#]&
Try it online!
Call with f[base][t]
. 0-indexed.
$endgroup$
1
$begingroup$
41 bytes
$endgroup$
– Expired Data
May 20 at 8:37
add a comment |
$begingroup$
Wolfram Language (Mathematica), 46 bytes
bNest[FromDigits[#~IntegerDigits~b]&,11,#]&
Try it online!
Call with f[base][t]
. 0-indexed.
$endgroup$
1
$begingroup$
41 bytes
$endgroup$
– Expired Data
May 20 at 8:37
add a comment |
$begingroup$
Wolfram Language (Mathematica), 46 bytes
bNest[FromDigits[#~IntegerDigits~b]&,11,#]&
Try it online!
Call with f[base][t]
. 0-indexed.
$endgroup$
Wolfram Language (Mathematica), 46 bytes
bNest[FromDigits[#~IntegerDigits~b]&,11,#]&
Try it online!
Call with f[base][t]
. 0-indexed.
answered May 19 at 23:33
attinatattinat
1,09718
1,09718
1
$begingroup$
41 bytes
$endgroup$
– Expired Data
May 20 at 8:37
add a comment |
1
$begingroup$
41 bytes
$endgroup$
– Expired Data
May 20 at 8:37
1
1
$begingroup$
41 bytes
$endgroup$
– Expired Data
May 20 at 8:37
$begingroup$
41 bytes
$endgroup$
– Expired Data
May 20 at 8:37
add a comment |
$begingroup$
Retina, 67 bytes
.+,(d+)
11,$1*
"$+"{`^d+
*
)+`(?=_.*,(_+))(1)*(_*)
$#2*_$.3
,_+
Try it online! Takes comma-separated inputs $t$ (0-indexed) and $b$. Does all of its calculations in unary so times out for large numbers. Explanation:
.+,(d+)
11,$1*
Initialise $x_0=11$ and convert $b$ to unary.
"$+"{`
Repeat $t$ times.
^d+
*
Convert $x_i$ to unary.
)+`(?=_.*,(_+))(1)*(_*)
$#2*_$.3
Convert to base $b$.
,_+
Delete $b$ from the output.
$endgroup$
add a comment |
$begingroup$
Retina, 67 bytes
.+,(d+)
11,$1*
"$+"{`^d+
*
)+`(?=_.*,(_+))(1)*(_*)
$#2*_$.3
,_+
Try it online! Takes comma-separated inputs $t$ (0-indexed) and $b$. Does all of its calculations in unary so times out for large numbers. Explanation:
.+,(d+)
11,$1*
Initialise $x_0=11$ and convert $b$ to unary.
"$+" push # of iterations
↑ₓ
Try it online!
$begingroup$
Perl 5 -Mbigint -pa
, 65 bytes
$=11;map$p=$;$%=0+"@F";$=($p%"@F").$while$p/=0+"@F"2..<>
Try it online!
answered May 22 at 20:50
XcaliXcali
5,938523
5,938523
add a comment |
add a comment |
If this is an answer to a challenge…
…Be sure to follow the challenge specification. However, please refrain from exploiting obvious loopholes. Answers abusing any of the standard loopholes are considered invalid. If you think a specification is unclear or underspecified, comment on the question instead.
…Try to optimize your score. For instance, answers to code-golf challenges should attempt to be as short as possible. You can always include a readable version of the code in addition to the competitive one.
Explanations of your answer make it more interesting to read and are very much encouraged.…Include a short header which indicates the language(s) of your code and its score, as defined by the challenge.
More generally…
…Please make sure to answer the question and provide sufficient detail.
…Avoid asking for help, clarification or responding to other answers (use comments instead).
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f185816%2fto-exponential-digit-growth-and-beyond%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
$begingroup$
Do we have to support larger numbers or just numbers up to 2^31 - 1?
$endgroup$
– Embodiment of Ignorance
May 19 at 23:39
1
$begingroup$
@EmbodimentofIgnorance The maximum of your language (Remember the standard loophole, though!)
$endgroup$
– MilkyWay90
May 19 at 23:43
$begingroup$
Is there a challenge that includes bases > 10? (In that case you would repeatedly interpret
11
as if it was in baseb
and convert it back to base 10, etc.)$endgroup$
– Neil
May 21 at 11:11
$begingroup$
@Neil I didn't include bases higher than 10 since (for example)
4a
wouldn't be a valid number in base-10$endgroup$
– MilkyWay90
May 22 at 22:49
$begingroup$
You wouldn't get
4a
, since you'd be interpreting the base 10 digits as baseb
and converting to base 10 each time (i.e. the other way around from this question).$endgroup$
– Neil
May 22 at 22:59