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.

A279756 Smallest prime p >= prime(n) such that p == 2 (mod prime(n)).

Original entry on oeis.org

2, 5, 7, 23, 13, 41, 19, 59, 71, 31, 157, 113, 43, 131, 331, 373, 61, 307, 337, 73, 367, 239, 251, 269, 293, 103, 311, 109, 547, 1019, 383, 919, 139, 419, 151, 757, 787, 491, 503, 521, 181, 907, 193, 967, 199, 599, 1901, 1117, 229, 2063, 701, 241, 3617, 1759, 773
Offset: 1

Views

Author

Thomas Ordowski and Altug Alkan, Dec 18 2016

Keywords

Comments

Conjecture: a(n) < prime(n)^2 for every n.
If this conjecture is true, then no terms are repeated.

Crossrefs

A006512 is a subsequence.

Programs

  • Maple
    a:= proc(n) local q, p; p:= ithprime(n); q:= p;
          do if irem(q-2, p)=0 then break fi;
             q:= nextprime(q);
          od; q
        end:
    seq(a(n), n=1..55);  # Alois P. Heinz, May 03 2021
  • Mathematica
    a[n_] := Module[{p = Prime[n], q}, q = p; While[True, If[Mod[q-2, p] == 0, Break[], q = NextPrime[q]]]; q];
    Table[a[n], {n, 1, 55}] (* Jean-François Alcover, Jun 13 2025, after Alois P. Heinz *)
  • PARI
    a(n) = {p = prime(n); q = p; while (Mod(q, p) != 2, q = nextprime(q+1)); q;} \\ Michel Marcus, Dec 18 2016
    
  • Python
    from itertools import dropwhile, count
    from sympy import isprime, prime
    def A279756(n): return next(dropwhile(lambda x:not isprime(x),count(2 if (p:=prime(n))==2 else p+2,p))) # Chai Wah Wu, Jan 04 2024