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.

A078773 a(n) is the largest prime less than or equal to phi(n), a(1) = a(2) = 0.

Original entry on oeis.org

0, 0, 2, 2, 3, 2, 5, 3, 5, 3, 7, 3, 11, 5, 7, 7, 13, 5, 17, 7, 11, 7, 19, 7, 19, 11, 17, 11, 23, 7, 29, 13, 19, 13, 23, 11, 31, 17, 23, 13, 37, 11, 41, 19, 23, 19, 43, 13, 41, 19, 31, 23, 47, 17, 37, 23, 31, 23, 53, 13, 59, 29, 31, 31, 47, 19, 61, 31, 43, 23, 67, 23, 71, 31, 37, 31
Offset: 1

Views

Author

Jon Perry, Jan 09 2003

Keywords

Comments

The original name was: "Prime preceding phi(n)". However, this is true only for n >= 7 from which onward phi(n) is guaranteed to get only composite values. For n = 3, 4 and 6 for which phi(n) = 2, a(n) = 2 also.

Examples

			phi(10)=4, hence a(10)=3.
		

Crossrefs

Programs

  • Mathematica
    If[#<0,0,#]&/@Table[NextPrime[EulerPhi[n]+1,-1],{n,80}] (* Harvey P. Dale, Aug 10 2012 *)
  • PARI
    for (n=1,100, print1(precprime(eulerphi(n))","))

Formula

a(1) = a(2) = 0 (by convention), and for n >= 3, a(n) = A007917(A000010(n)). - Antti Karttunen, Dec 05 2017

Extensions

Name changed by Antti Karttunen, Dec 05 2017