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.

A129227 a(n) is that prime number, p, less than n*Pi such that n*Pi/p has the smallest fractional part.

Original entry on oeis.org

3, 3, 3, 11, 5, 17, 7, 5, 7, 31, 17, 37, 37, 43, 47, 5, 53, 53, 59, 31, 13, 23, 71, 73, 13, 79, 83, 29, 13, 47, 97, 97, 103, 53, 109, 113, 29, 17, 61, 31, 127, 131, 67, 137, 47, 71, 73, 149, 151, 157, 157, 163, 83, 167, 43, 173, 179, 181, 37, 47, 191, 97, 197, 67, 17, 103
Offset: 1

Views

Author

Axel Harvey, Apr 04 2007

Keywords

Examples

			a(4)=11 because 4*Pi/11 = 1.142... and the fractional part 0.142... represents the smallest remainder resulting from the division of 4*Pi by a prime number less than 4*Pi.
		

Crossrefs

Cf. A129228.

Programs

  • Mathematica
    f[n_] := (p = Denominator[ Min[ FractionalPart[(n*Pi / Prime@ Range@ PrimePi[n*Pi])]] [[2]]]; If[p == 1, n, p]); Array[f, 66] (* Robert G. Wilson v, Apr 08 2007 *)
  • Sage
    A129227 = lambda n: sorted(primes(floor(n*pi)+1), key=lambda p: (n*pi/p-floor(n*pi/p)))[0] # D. S. McNeil, Dec 11 2010

Extensions

Edited and extended by Robert G. Wilson v, Apr 08 2007