|
Search: id:A130860
|
|
|
| A130860 |
|
Number of decimal places of pi given by integer approximations of the form a^1/n. |
|
+0 1
|
|
| 0, 0, 2, 2, 4, 2, 3, 4, 5, 5, 6, 6, 6, 6, 9, 9, 9, 10, 10, 11, 11, 13, 12, 13, 13, 14, 14, 14
(list; graph; listen)
|
|
|
OFFSET
|
1,3
|
|
|
FORMULA
|
a(n) = decimal_places in (round(pi^n))^1/n w.r.t. pi Note round(pi^n) is the sequence A002160 Nearest integer to pi^n.
|
|
EXAMPLE
|
a(8)=4 because 3.1416...= 9489^(1/8) is pi accurate to 4 decimal places
|
|
PROGRAM
|
[Python] import math from math import pi, floor, ceil def round(x): return math.floor(x+0.5) def decimal_places(x, y): #print 'decimal_places(%.10f, %1.0f)' % (x, y) dp = -1 # Compare integer part, shift 1 dp while(floor(x+0.5)==floor(y+0.5) and x and y): x = (x-floor(x)) * 10 y = (y-floor(y)) * 10 dp = dp+1 return dp for n in range(1, 30): pi_to_the_n = pow(pi, n) pi_to_the_n_rnd = round(pi_to_the_n) pi_approx = pow(pi_to_the_n_rnd, 1.0/n) dps = decimal_places(pi_approx, pi) print '%d: %d dps : %.15g = %.0f^(1/%d)' % (n, dps, pi_approx, pi_to_the_n_rnd, n) #print dps,
|
|
CROSSREFS
|
Cf. A002160.
Sequence in context: A103274 A046820 A043262 this_sequence A138785 A131817 A138232
Adjacent sequences: A130857 A130858 A130859 this_sequence A130861 A130862 A130863
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
Stephen McInerney (spmcinerney(AT)hotmail.com), Jul 22 2007
|
|
|
Search completed in 0.002 seconds
|