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)).

This page as a plain text file.
%I A279756 #29 Jun 13 2025 08:21:50
%S A279756 2,5,7,23,13,41,19,59,71,31,157,113,43,131,331,373,61,307,337,73,367,
%T A279756 239,251,269,293,103,311,109,547,1019,383,919,139,419,151,757,787,491,
%U A279756 503,521,181,907,193,967,199,599,1901,1117,229,2063,701,241,3617,1759,773
%N A279756 Smallest prime p >= prime(n) such that p == 2 (mod prime(n)).
%C A279756 Conjecture: a(n) < prime(n)^2 for every n.
%C A279756 If this conjecture is true, then no terms are repeated.
%H A279756 Alois P. Heinz, <a href="/A279756/b279756.txt">Table of n, a(n) for n = 1..10000</a>
%p A279756 a:= proc(n) local q, p; p:= ithprime(n); q:= p;
%p A279756       do if irem(q-2, p)=0 then break fi;
%p A279756          q:= nextprime(q);
%p A279756       od; q
%p A279756     end:
%p A279756 seq(a(n), n=1..55);  # _Alois P. Heinz_, May 03 2021
%t A279756 a[n_] := Module[{p = Prime[n], q}, q = p; While[True, If[Mod[q-2, p] == 0, Break[], q = NextPrime[q]]]; q];
%t A279756 Table[a[n], {n, 1, 55}] (* _Jean-François Alcover_, Jun 13 2025, after _Alois P. Heinz_ *)
%o A279756 (PARI) a(n) = {p = prime(n); q = p; while (Mod(q, p) != 2, q = nextprime(q+1)); q;} \\ _Michel Marcus_, Dec 18 2016
%o A279756 (Python)
%o A279756 from itertools import dropwhile, count
%o A279756 from sympy import isprime, prime
%o A279756 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
%Y A279756 A006512 is a subsequence.
%Y A279756 Cf. A000040, A034694.
%K A279756 nonn
%O A279756 1,1
%A A279756 _Thomas Ordowski_ and _Altug Alkan_, Dec 18 2016