Ah, in that case you can use the formula in the Wikipedia page you cited <https://en.wikipedia.org/wiki/Approximations_of_%CF%80#Digit_extraction_methods>. The first formula has the factor (%16)^n . That factor limits the contribution to the n-th hex digit both from the left and from the right.
g=: 3 : '+/ 4 _2 _1 _1 % 1 4 5 6 + 8x * y' 10^.16 1.20412 1e4%1.2 8333.33 t=: g 8334 t 8335925201r2470518805025963211 0j_10 ": t 3.3741597854e_9 That is, for the 8334-th hex digit (approximately the 1e4-th decimal digit), you probably don't need to look at many terms before the 8334-th one, or any of the terms after it. 2}.0j100 ": +/ (16x&^ %~ g"0) i.50 1415926535897932384626433832795028841971693993751058209749445922466544481906209319125159482533123957 1}.":<.@o. 10^100x 1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679 Alternatively, enter f 1e4 and wait. :-) On Tue, Jan 6, 2015 at 1:04 PM, 'Pascal Jasmin' via Programming < [email protected]> wrote: > to be more specific, a function that gets the 10000th digit of pi? > > > ----- Original Message ----- > From: Roger Hui <[email protected]> > To: Programming forum <[email protected]> > Cc: > Sent: Tuesday, January 6, 2015 3:58 PM > Subject: Re: [Jprogramming] nth digit of pi > > Answering the letter if not the spirit of your question: > > f=: 3 : '10|<.@o. 10x^y' > f"0 i.5 20 > 3 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 > 6 2 6 4 3 3 8 3 2 7 9 5 0 2 8 8 4 1 9 7 > 1 6 9 3 9 9 3 7 5 1 0 5 8 2 0 9 7 4 9 4 > 4 5 9 2 3 0 7 8 1 6 4 0 6 2 8 6 2 0 8 9 > 9 8 6 2 8 0 3 4 8 2 5 3 4 2 1 1 7 0 6 7 > > > > On Tue, Jan 6, 2015 at 12:50 PM, 'Pascal Jasmin' via Programming < > [email protected]> wrote: > > > I don't really understand this well: > > > > > > > http://en.wikipedia.org/wiki/Approximations_of_%CF%80#Digit_extraction_methods > > > > is there a J program for finding the y th digit of pi (any base is ok) > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
