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.

A185191 a(n) = 2^n - second largest prime less than 2^n.

Original entry on oeis.org

2, 3, 5, 3, 5, 15, 15, 9, 5, 19, 5, 13, 15, 49, 17, 9, 11, 19, 5, 19, 17, 21, 17, 49, 27, 79, 89, 33, 41, 19, 17, 25, 77, 49, 17, 31, 87, 19, 167, 31, 17, 67, 117, 69, 57, 127, 65, 111, 35, 139, 143, 145, 53, 67, 27, 25, 57, 99, 107, 31, 87, 165, 83
Offset: 2

Views

Author

Washington Bomfim, Jan 23 2012

Keywords

Examples

			a(2)=2 because precprime(4)=3, and precprime(2)=2.
		

References

  • D. E. Knuth, The Art of Computer Programming Second Edition. Vol. 2, Seminumerical Algorithms. Chapter 4.5.4 Factoring into Primes, Table 1, Page 390, Addison-Wesley, Reading, MA, 1981.

Crossrefs

Cf. A013603.

Programs

  • Mathematica
    Table[2^n - NextPrime[2^n, -2], {n, 2, 64}] (* T. D. Noe, Jan 24 2012 *)
    #-NextPrime[#,-2]&/@(2^Range[2,70]) (* Harvey P. Dale, Mar 29 2025 *)

Formula

a(n) = 2^n - precprime(precprime(2^n)-1)