cp's OEIS Frontend

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.

Showing 1-8 of 8 results.

A001672 a(n) = floor(Pi^n).

Original entry on oeis.org

1, 3, 9, 31, 97, 306, 961, 3020, 9488, 29809, 93648, 294204, 924269, 2903677, 9122171, 28658145, 90032220, 282844563, 888582403, 2791563949, 8769956796, 27551631842, 86556004191, 271923706893, 854273519913, 2683779414317, 8431341691876, 26487841119103
Offset: 0

Views

Author

Keywords

Crossrefs

See also A002160: closest integer to Pi^n.
Cf. A001673.

Programs

Formula

a(n)^(1/n) converges to Pi because |1 - a(n)/Pi^n| = |Pi^n - a(n)|/Pi^n < 1/Pi^n and so a(n)^(1/n) = (Pi^n*(1+o(1)))^(1/n) = Pi*(1+o(1)). - Hieronymus Fischer, Jan 22 2006

A000227 Nearest integer to e^n.

Original entry on oeis.org

1, 3, 7, 20, 55, 148, 403, 1097, 2981, 8103, 22026, 59874, 162755, 442413, 1202604, 3269017, 8886111, 24154953, 65659969, 178482301, 485165195, 1318815734, 3584912846, 9744803446, 26489122130, 72004899337, 195729609429, 532048240602, 1446257064291, 3931334297144, 10686474581524
Offset: 0

Views

Author

Keywords

Comments

x = e^n is the location of the maximum of x^(1/x^(1/n)). One can define another sequence, c(n) as the value of the natural number k that maximizes k^(1/k^(1/n)). Empirically, despite the rounding, c(n) and a(n) match each other until at least n>24500 (see the link). - Stanislav Sykora, Jun 06 2014

References

  • Federal Works Agency, Work Projects Administration for the City of NY, Tables of the Exponential Function. National Bureau of Standards, Washington, DC, 1939.
  • A. Fletcher, J. C. P. Miller, L. Rosenhead and L. J. Comrie, An Index of Mathematical Tables. Vols. 1 and 2, 2nd ed., Blackwell, Oxford and Addison-Wesley, Reading, MA, 1962, Vol. 1, p. 230.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000149 (floor e^n), A001671 (e^n rounded up), A002160 (nearest integer to Pi^n).

Programs

  • Maple
    Digits := 40: [seq(round(exp(n)), n=0..30)];
  • Mathematica
    Table[ Round[ N[E^n] ], {n, 0, 30} ]
    Round[E^Range[0,30]] (* Harvey P. Dale, Jul 28 2025 *)
  • PARI
    apply( A000227(n)=exp(n)\/1, [0..50]) \\ An error message will say so if default(realprecision) must be increased. - M. F. Hasler, May 27 2018

A001675 a(n) = round(sqrt( 2*Pi )^n).

Original entry on oeis.org

1, 3, 6, 16, 39, 99, 248, 622, 1559, 3907, 9793, 24546, 61529, 154230, 386598, 969056, 2429064, 6088760, 15262259, 38256810, 95895601, 240374624, 602529829, 1510318305, 3785806568, 9489609784, 23786924201, 59624976768, 149457652642, 374634777972
Offset: 0

Views

Author

Keywords

Crossrefs

Cf. A001674 (floor sqrt(2 Pi)^n), A001698 (ceiling sqrt(2 Pi)^n).
Cf. A017911 (round sqrt(2)), A000227 (round e^n), A002160 (round Pi^n).

Programs

  • Mathematica
    Table[Floor[Sqrt[2*Pi]^n + 1/2], {n, 0, 50}] (* T. D. Noe, Aug 09 2012 *)
    Round[(Sqrt[2*Pi])^Range[0,30] ] (* Harvey P. Dale, Jun 05 2018 *)
  • PARI
    apply( a(n)=(2*Pi)^(n/2)\/1, [0..40]) \\ M. F. Hasler, May 29 2018

A386725 a(n) is the nearest integer to n/log_10(Pi).

Original entry on oeis.org

0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123, 125, 127, 129
Offset: 0

Views

Author

Stefano Spezia, Jul 31 2025

Keywords

Comments

Differs from A005843 for n > 43.
For n > 0, a(n) is the nonnegative integer such that abs(10^(n/a(n)) - Pi) is minimum.

Examples

			a(n) = 2*n corresponds to the Brahmagupta's approximation 10^(1/2) = sqrt(10) of Pi (cf. A010467).
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Round[n/Log10[Pi]]; Array[a,65,0]

Formula

a(n) = round(n/log10(Pi)).
a(n) >= 2*n.

A080072 Values of n such that Pi^n is farther from its closest integer than any Pi^k for 1 <= k < n.

Original entry on oeis.org

1, 4, 8, 31, 61, 89, 200, 217, 257, 1366, 3642, 4926, 20265
Offset: 1

Views

Author

Mark Hudson (mrmarkhudson(AT)hotmail.com), Jan 24 2003

Keywords

Comments

"Farthest from an integer" only really makes sense if we choose "nearest" or "farthest" integer. I chose nearest here. "Farthest from farthest" would just make "nearest to nearest" and would be sequence A080052. I think.

Examples

			E.g., Pi^1=3.14159265... Pi^2=9.869..., Pi^3=31.00627..., Pi^4=97.40909... so Pi^4 is farther from 97 (its closest integer) than Pi^3 is from 31, or Pi^2 is from 10.
		

Crossrefs

Programs

  • Maple
    b := array(1..5000): Digits := 10000: c := 0: pos := 0: for n from 1 to 10000 do: exval := evalf(Pi^n): if (abs(exval-round(exval))>c) then c := (abs(exval-round(exval))): pos := pos+1: b[pos] := n: print(n):fi: od: seq(b[n],n=1..pos);
  • PARI
    default(realprecision,20000);d=0.0;p=Pi;a=1;for(n=1,40000,a*=p; s=abs(a-round(a));if(s>d,d=s;print1(n,","))) \\ Robert Gerbicz, Aug 22 2006

Extensions

More terms from Robert Gerbicz, Aug 22 2006

A092786 a(n) = round(n*Pi^n).

Original entry on oeis.org

3, 20, 93, 390, 1530, 5768, 21142, 75908, 268282, 936480, 3236244, 11091230, 37747805, 127710397, 429872190, 1440515533, 4808357581, 15994483255, 53039715042, 175399135922, 578584268700, 1904232092224, 6254245258553
Offset: 1

Views

Author

Jorge Coveiro, Apr 14 2004

Keywords

Crossrefs

Cf. A002160.

Programs

  • Maple
    Digits:=30; seq( (round(x*Pi^x)), x=1..60);
  • Mathematica
    Table[Round[n*Pi^n],{n,30}] (* Harvey P. Dale, Aug 01 2020 *)

A130860 Number of decimal places of Pi given by integer approximations of the form a^(1/n).

Original entry on oeis.org

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
Offset: 1

Views

Author

Stephen McInerney (spmcinerney(AT)hotmail.com), Jul 22 2007

Keywords

Comments

Approximations are rounded, not truncated; see the example for n=2. Note that this can produce anomalous results; e.g., 0.148 does not match 0.152 to 1-place accuracy, but does match it to 2-place accuracy. - Franklin T. Adams-Watters, Mar 29 2014

Examples

			a(8)=4 because 9489^(1/8) = 3.1416... is Pi accurate to 4 decimal places.
a(2)=0. 10^(1/2) = 3.16... rounded to one place is 3.2, while Pi to one place is 3.1.
		

Crossrefs

Cf. A002160.

Programs

  • Python
    from math import pi, floor, ceil
    def round(x):
        return math.floor(x + 0.5)
    def decimal_places(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(dps)

Formula

a(n) is the number of decimal_places in (round(Pi^n))^1/n w.r.t. Pi.
Note that round(Pi^n) is the sequence A002160 (Nearest integer to Pi^n).

A305289 Powers of 2*Pi, rounded to the nearest integer.

Original entry on oeis.org

1, 6, 39, 248, 1559, 9793, 61529, 386598, 2429064, 15262259, 95895601, 602529829, 3785806568, 23786924201, 149457652642, 939070127125, 5900351625162, 37073002638414, 232936545470713, 1463583480006755, 9195966217409213, 57779959822545404, 363042194606444109, 2281061383037441740
Offset: 0

Views

Author

M. F. Hasler, May 29 2018

Keywords

Crossrefs

Cf. A001674 (floor(sqrt(2 Pi)^n)), A001675 (round sqrt(2 Pi)^n), A001698 (ceiling sqrt(2 Pi)^n), A017911 (round sqrt(2)^n), A000227 (round e^n), A002160 (round Pi^n).

Programs

  • Mathematica
    Round[(2Pi)^Range[0,30]] (* Harvey P. Dale, Aug 12 2021 *)
  • PARI
    apply( a(n)=(2*Pi)^n\/1, [0..40])

Formula

a(n) = round((2 Pi)^n) = A001675(2*n) >= A001674(2n).
Showing 1-8 of 8 results.