A065032 Erroneous version of A007514.
3, 0, 0, 0, 3, 1, 5, 6, 5, 0, 1, 4, 7, 8, 0, 6, 7, 10, 7, 10, 4, 10, 6, 16, 1, 11, 20, 3, 18, 12, 9, 13
Offset: 0
This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
3.1415926535897932384626433832795028841971693993751058209749445923078164062\ 862089986280348253421170679821480865132823066470938446095505822317253594081\ 284811174502841027019385211055596446229489549303819...
-- see link: Literate Programs import Data.Char (digitToInt) a000796 n = a000796_list (n + 1) !! (n + 1) a000796_list len = map digitToInt $ show $ machin' `div` (10 ^ 10) where machin' = 4 * (4 * arccot 5 unity - arccot 239 unity) unity = 10 ^ (len + 10) arccot x unity = arccot' x unity 0 (unity `div` x) 1 1 where arccot' x unity summa xpow n sign | term == 0 = summa | otherwise = arccot' x unity (summa + sign * term) (xpow `div` x ^ 2) (n + 2) (- sign) where term = xpow `div` n -- Reinhard Zumkeller, Nov 24 2012
-- See Niemeijer link and also Gibbons link. a000796 n = a000796_list !! (n-1) :: Int a000796_list = map fromInteger $ piStream (1, 0, 1) [(n, a*d, d) | (n, d, a) <- map (\k -> (k, 2 * k + 1, 2)) [1..]] where piStream z xs'@(x:xs) | lb /= approx z 4 = piStream (mult z x) xs | otherwise = lb : piStream (mult (10, -10 * lb, 1) z) xs' where lb = approx z 3 approx (a, b, c) n = div (a * n + b) c mult (a, b, c) (d, e, f) = (a * d, a * e + b * f, c * f) -- Reinhard Zumkeller, Jul 14 2013, Jun 12 2013
py(x) := if equal(6,6+x^2) then 2*x else (py(x:x/3),3*%%-4*(%%-x)^3); py(3.); py(dfloat(%)); block([bfprecision:35], py(bfloat(%))) /* Bill Gosper, Sep 09 2002 */
pi:=Pi(RealField(110)); Reverse(Intseq(Floor(10^105*pi))); // Bruno Berselli, Mar 12 2013
Digits := 110: Pi*10^104: ListTools:-Reverse(convert(floor(%), base, 10)); # Peter Luschny, Oct 29 2019
RealDigits[ N[ Pi, 105]] [[1]] Table[ResourceFunction["NthDigit"][Pi, n], {n, 1, 102}] (* Joan Ludevid, Jun 22 2022; easy to compute a(10000000)=7 with this function; requires Mathematica 12.0+ *)
{ default(realprecision, 20080); x=Pi; for (n=1, 20000, d=floor(x); x=(x-d)*10; write("b000796.txt", n, " ", d)); } \\ Harry J. Smith, Apr 15 2009
A796=[]; A000796(n)={if(n>#A796, localprec(n*6\5+29); A796=digits(Pi\.1^(precision(Pi)-3))); A796[n]} \\ NOTE: as the other programs, this returns the n-th term of the sequence, with n = 1, 2, 3, ... and not n = 1, 0, -1, -2, .... - M. F. Hasler, Jun 21 2022
first(n)= default(realprecision, n+10); digits(floor(Pi*10^(n-1))) \\ David A. Corneth, Jun 21 2022
lista(nn, p=20)= {my(u=10^(nn+p+1), f(x, u)=my(n=1, q=u\x, r=q, s=1, t); while(t=(q\=(x*x))\(n+=2), r+=(s=-s)*t); r*4); digits((4*f(5, u)-f(239, u))\10^(p+2)); } \\ Machin-like, with p > the maximal number of consecutive 9-digits to be expected (A048940) - Ruud H.G. van Tol, Dec 26 2024
from sympy import pi, N; print(N(pi, 1000)) # David Radcliffe, Apr 10 2019
from mpmath import mp def A000796(n): if n >= len(A000796.str): mp.dps = n*6//5+50; A000796.str = str(mp.pi-5/mp.mpf(10)**mp.dps) return int(A000796.str[n if n>1 else 0]) A000796.str = '' # M. F. Hasler, Jun 21 2022
m=125 x=numerical_approx(pi, digits=m+5) a=[ZZ(i) for i in x.str(skip_zeroes=True) if i.isdigit()] a[:m] # G. C. Greubel, Jul 18 2023
11.0010010000111111011010101000100010000...
convert(evalf(Pi), binary, 120); # Alois P. Heinz, Dec 16 2018
RealDigits[Pi, 2, 75][[1]] Table[ResourceFunction["NthDigit"][Pi, n, 2], {n, 1, 100}] (* Joan Ludevid, Jun 24 2022;easy to compute a(10000000)=0 with this function; requires Mathematica 12.0+ *)
binary(Pi) \\ Altug Alkan, Apr 08 2018
3.243f6a8885a308d3...
RealDigits[ N[ Pi, 115], 16] [[1]]
{ default(realprecision, 24300); x=Pi; for (n=1, 20000, d=floor(x); x=(x-d)*16; write("b062964.txt", n, " ", d)); } \\ Harry J. Smith, Apr 27 2009
N=50; default(realprecision,.75*N); A062964=digits(Pi*16^N\1,16) \\ M. F. Hasler, Mar 14 2015
10.0102110122220102110021111102212222201...
RealDigits[ N[ Pi, 105], 3] [[1]] RealDigits[Pi,3,120][[1]] (* Harvey P. Dale, Jul 02 2021 *) Table[ResourceFunction["NthDigit"][Pi, n, 3], {n, 1, 100}] (* Joan Ludevid, Jun 24 2022;easy to compute a(10000000)=1 with this function;requires Mathematica 12.0+ *)
3.12418812407442788645177761731035828516...
RealDigits[Pi, 9, 105][[1]] Table[ResourceFunction["NthDigit"][Pi, n, 9], {n, 1, 105}] (* Joan Ludevid, Oct 09 2022 easy to compute a(10000000)=5 with this function; requires Mathematica 12.0+ *)
3.02100333122220202011220300203103010301...
RealDigits[Pi, 4, 100][[1]] Table[ResourceFunction["NthDigit"][Pi, n, 4], {n, 1, 100}] (* Joan Ludevid, Jul 04 2022; easy to compute a(10000000)=2 with this function; requires Mathematica 12.0+ *)
3.21cd1dc46c2b...
RealDigits[ N[ Pi, 115], 15] [[1]] RealDigits[Pi,15,120][[1]] (* Harvey P. Dale, Aug 05 2025 *)
3.16150702865a4...
RealDigits[Pi, 11, 111][[1]] Table[ResourceFunction["NthDigit"][Pi, n, 11], {n, 1, 111}] (* Joan Ludevid, Oct 09 2022 easy to compute a(10000000)=10 with this function; requires Mathematica 12.0+ *)
3.184809493b918664573b6211bb151551a05729...
RealDigits[Pi,12,120][[1]] (* Harvey P. Dale, Jul 04 2014 *) Table[ResourceFunction["NthDigit"][Pi, n, 12], {n, 1, 120}] (* Joan Ludevid, Oct 11 2022; easy to compute a(10000000)=8 with this function; requires Mathematica 12.0+ *)
Comments