login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A256516 Numbers obtained by removing the first a(n) > 0 decimal digits of Pi set new records for closeness to Pi. 1

%I #48 Apr 07 2015 15:36:37

%S 1,2,102,249,294,1635,3647,5105,6954,357593,416507,497533,821581,

%T 1299504,1457054,39082410,45969853,47607985,86389357,121338042,

%U 183331620,191525092,198003319,388055713,427238910,570434345,678096433

%N Numbers obtained by removing the first a(n) > 0 decimal digits of Pi set new records for closeness to Pi.

%C Suppose you forget the first a(n) digits of Pi after the 3, but remember the rest - these values are the record-setting best approximations to Pi.

%C a(28) > 4.9*10^9. - _Robert G. Wilson v_, Apr 03 2015

%e a(1) = 1, giving an approximation 3.4159...

%e a(2) = 2, because 3.1592... is closer to Pi than 3.4159...

%e a(3) = 102, because 3.14808... is closer to Pi than any value obtained by removing fewer than 102 of the first decimal digits of Pi.

%e a(27) = 678096433, because 3.141592653607137185825... is closer to Pi than any value obtained by removing fewer than 678096433 of the first decimal digits of Pi. - _Robert G. Wilson v_, Apr 04 2015

%t pi = N[Pi - 3, 1000000]; k = 1; d = Infinity; lst = {}; While[k < 990000, pi = 10 pi - IntegerPart[10 pi]; If[ Abs[Pi - 3 - pi] < d, d = Abs[Pi - 3 - pi]; AppendTo[lst, k]; Print[k]]; k++]; lst (* _Robert G. Wilson v_, Apr 01 2015 *)

%o (Python)

%o def a256516():

%o ....best = 1

%o ....yield 1

%o ....i = 2

%o ....while True:

%o ........if i>=len(pi):

%o ............return

%o ........a = pi[i]

%o ........valid = True

%o ........o = 1

%o ........while valid:

%o ............pi_approx = int(pi[:o])

%o ............a_approx = abs(int(pi[i:i+o])-pi_approx)

%o ............b_approx = abs(int(pi[best:best+o])-pi_approx)

%o ............if abs(b_approx-a_approx)>10:

%o ................valid = False

%o ............else:

%o ................o+=1

%o ........if a_approx<b_approx:

%o ............best = i

%o ............yield i

%o ........i+=1

%Y Cf. Decimal expansion of Pi: A000796.

%K nonn,base,more

%O 1,2

%A _Christian Perfect_, Apr 01 2015

%E a(10)-a(13) from _Robert G. Wilson v_, Apr 01 2015

%E a(14)-a(19) from _Robert G. Wilson v_, Apr 02 2015

%E a(20)-a(27) from _Robert G. Wilson v_, Apr 03 2015

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 13:08 EDT 2024. Contains 371945 sequences. (Running on oeis4.)