-4
4
This challenge is to produce the shortest code for the constant \$\pi^{1/\pi}\$. Your code must output the first \$n\$ consecutive digits of \$\pi^{1/\pi}\$, where \$n\$ is given in the input. Alternatively, your program may accept no input, and output digits indefinitely
This is code golf, so the shortest submission (in bytes) wins except that it must output the 1000 digits for \$n = 1000\$ in less than 10 seconds on a reasonable PC.
You may not use a built-in for \$\pi\$, the gamma function or any trigonometic functions.
If the input is \$n = 1000\$ then the output should be:
1.439619495847590688336490804973755678698296474456640982233160641890243439489175847819775046598413042034429435933431518691836732951984722119433079301671110102682697604070399426193641233251599869541114696602206159806187886346672286578563675195251197506612632994951137598102148536309069039370150219658973192371016509932874597628176884399500240909395655677358944562363853007642537831293187261467105359527145042168086291313192180728142873804095866545892671050160887161247841159801201214341008864056957496443082304938474506943426362186681975818486755037531745030281824945517346721827951758462729435404003567168481147219101725582782513814164998627344159575816112484930170874421446660340640765307896240719748580796264678391758752657775416033924968325379821891397966642420127047241749775945321987325546370476643421107677192511404620404347945533236034496338423479342775816430095564073314320146986193356277171415551195734877053835347930464808548912190359710144741916773023586353716026553462614686341975282183643
Note the 1000 decimal places includes the first \$1\$.
Output format
Your code can output in any format you wish.
This related question tackles a simpler variant but with the same restrictions.
Notes
If it's helpful, you can assume \$\pi^{1/\pi}\$ is irrational and in fact you can even assume it is a Normal number.
9
Banning a built-in for pi or trigonometric functions is kind of useless. For example, we can use $\Gamma(1/2)^2$
– Luis Mendo – 2019-05-20T09:05:40.7334I'm curious, is this even possible? Could it not be that digit number 1000000 of
pi^(1/pi)
relies on digit number 1000099? Or even 9999999, in theory at least..? At some point you'll have...4599999999999999999999999999999999......
, but that could be4600000000000000000000000000000000.....
if your calculations included more digits. I believe it's impossible to say how many more digits is needed..? Or? – Stewie Griffin – 2019-05-20T10:01:16.8171@StewieGriffin It's certainly possible but I don't know how quickly you can add a new digit once you have already outputted thousands, say. – Anush – 2019-05-20T10:28:44.013
11Why the restriction on how the digits are output? It adds absolutely nothing to the challenge. – Shaggy – 2019-05-20T11:12:56.917
You said that it should print digits forever. Can we assume infinite memory or only infinite time? Do we have to come up with some clever way to calculate the 10^15th digit without using more than a petabyte of memory? – Stewie Griffin – 2019-05-20T11:21:06.703
@StewieGriffin It is possible, but the number of digits cannot be known in advance. Instead, it should be computed on the fly, which makes the challenge ¿unnecessarily? complicated
– Luis Mendo – 2019-05-20T12:10:19.9502
For the record: https://math.stackexchange.com/q/3232906/92515
– Stewie Griffin – 2019-05-20T12:46:39.627@StewieGriffin You can assume both infinite memory and time. – Anush – 2019-05-20T13:00:15.433
1I'm not sure that Generally you may not use any built-in that computes pi for you means. If my language has a variable-precision function that takes a string like
'pi'
and a numberN
and symbolically computesN
decimals of what the string represents, is that acceptable? – Luis Mendo – 2019-05-20T13:52:04.9303Is
ConvertDegreesToRadians(180)
interesting enough as a way to produce pi? – my pronoun is monicareinstate – 2019-05-20T15:26:01.5072How can a [tag:restricted-time] challenge assume infinite time? – Xcali – 2019-05-24T21:26:41.480
@Xcali. The challenge has been edited since it was closed (and now reopened). In any case, the time is restricted for the n=1000 case. – Anush – 2019-05-25T04:00:47.870
Is there a way to calculate that number without use pi? – RosLuP – 2019-05-25T10:56:26.440
1@RosLuP You can compute $\pi$ to enough precision and go from there or try to find a direct way to compute $\pi^{1/\pi}$ without first computing $\pi$. I think both are good. – Anush – 2019-05-26T10:10:07.547