login
A037028
Prime closest to e^n.
5
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,1
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 0..500
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} ]
CROSSREFS
Sequence in context: A122724 A256758 A033844 * A052919 A005807 A167422
KEYWORD
nonn
EXTENSIONS
Corrected and extended by Robert G. Wilson v, Sep 16 2000
STATUS
approved