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.

A037028 Prime closest to e^n.

Original entry on oeis.org

2, 3, 7, 19, 53, 149, 401, 1097, 2971, 8101, 22027, 59879, 162751, 442399, 1202603, 3269011, 8886109, 24154957, 65659969, 178482289, 485165237, 1318815713, 3584912833, 9744803443, 26489122147, 72004899319
Offset: 0

Views

Author

Keywords

Programs

  • Mathematica
    NextPrime[ n_Integer ] := Module[ {k = n + 1}, While[ ! PrimeQ[ k ], k++ ]; Return[ k ] ]; PrevPrime[ n_Integer ] := Module[ {k = n - 1}, While[ ! PrimeQ[ k ], k-- ]; Return[ k ] ]; Do[ a = Round[ N[ E^n ] ]; b = NextPrime[ Round[ N[ E^n ] ] - 1 ]; c = PrevPrime[ Round[ N[ E^n ] ] + 1 ]; If[ b - N[ E^n ] > N[ E^n ] - c, Print[ c ], Print[ b ] ], {n, 0, 25} ]
    Table[np=NextPrime[E^n];pp=NextPrime[E^n,-1];If[E^n-ppJames C. McMahon, Dec 25 2024 *)
    pce[n_]:=Module[{c=E^n,np,pp},np=NextPrime[c];pp=NextPrime[c,-1];Nearest[{pp,np},c]]; Array[pce,30,0]//Flatten (* Harvey P. Dale, Jan 30 2025 *)

Extensions

Corrected and extended by Robert G. Wilson v, Sep 16 2000