|
|
A256516
|
|
Numbers obtained by removing the first a(n) > 0 decimal digits of Pi set new records for closeness to Pi.
|
|
1
|
|
|
1, 2, 102, 249, 294, 1635, 3647, 5105, 6954, 357593, 416507, 497533, 821581, 1299504, 1457054, 39082410, 45969853, 47607985, 86389357, 121338042, 183331620, 191525092, 198003319, 388055713, 427238910, 570434345, 678096433
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
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.
|
|
LINKS
|
|
|
EXAMPLE
|
a(1) = 1, giving an approximation 3.4159...
a(2) = 2, because 3.1592... is closer to Pi than 3.4159...
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.
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
|
|
MATHEMATICA
|
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 *)
|
|
PROG
|
(Python)
def a256516():
....best = 1
....yield 1
....i = 2
....while True:
........if i>=len(pi):
............return
........a = pi[i]
........valid = True
........o = 1
........while valid:
............pi_approx = int(pi[:o])
............a_approx = abs(int(pi[i:i+o])-pi_approx)
............b_approx = abs(int(pi[best:best+o])-pi_approx)
............if abs(b_approx-a_approx)>10:
................valid = False
............else:
................o+=1
........if a_approx<b_approx:
............best = i
............yield i
........i+=1
|
|
CROSSREFS
|
Cf. Decimal expansion of Pi: A000796.
|
|
KEYWORD
|
nonn,base,more
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|