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.

A242961 The smallest prime p > prime(n) such that p mod prime(n) == - 1.

Original entry on oeis.org

3, 5, 19, 13, 43, 103, 67, 37, 137, 173, 61, 73, 163, 257, 281, 211, 353, 487, 401, 283, 1021, 157, 331, 1423, 193, 1009, 617, 641, 653, 677, 761, 523, 547, 277, 1489, 1811, 313, 977, 1669, 691, 1789, 1447, 4201, 1543, 787, 397, 421, 1783, 907, 457, 3727
Offset: 1

Views

Author

Torlach Rush, May 27 2014

Keywords

Comments

If the condition a(n) > prime(n) is removed, then we get sequence A032448. This differs only at n = 2 since if p <= prime(n) and p == -1 (mod prime(n)), then p must be prime(n) - 1. The only solution is p = 2, prime(n) = 3. - Michael B. Porter, Jul 01 2014 and Michel Marcus, May 28 2014

Examples

			a(1) = 3, because for the first prime, 2, we have 3 mod 2 = 2 - 1.
a(2) = 5, because for the second prime, 3, we have 5 mod 3 = 3 - 1.
a(3) = 19, because for the third prime, 5, we have 19 mod 5 = 5 - 1.
		

Crossrefs

Cf. A032448.

Programs

  • PARI
    a(n) = {q = prime(n); forprime(p=q, ,if (p % q == q - 1, return (p);););} \\ Michel Marcus, May 28 2014

Formula

a(n) = min(p: p mod prime(n) == - 1 and p > prime(n)).

Extensions

More terms from Michel Marcus, May 28 2014