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.

A321992 a(n) is the least prime q different from p = prime(n) such that 2^(q-1) == 1 (mod p), or 0 if no such prime exists.

Original entry on oeis.org

0, 5, 13, 13, 31, 37, 41, 37, 67, 113, 11, 73, 61, 29, 139, 157, 233, 181, 199, 211, 19, 157, 739, 23, 193, 401, 307, 743, 37, 29, 29, 521, 409, 277, 593, 31, 53, 487, 499, 1033, 1069, 541, 571, 97, 1373, 397, 421, 149, 1583, 457, 59, 953, 73, 101, 17, 787, 1609, 541, 461
Offset: 1

Views

Author

M. F. Hasler, Mar 15 2019

Keywords

Comments

a(n) = 0 only for n = 1, p = 2. For any odd prime, a prime q meeting the requirement does exist.
a(n) is the smallest prime q <> p such that q == 1 (mod ord_{p}(2)), where ord_{p}(2) = A002326((p-1)/2) = A014664(n). Strong conjecture: a(n) < A014664(n)^2. - Thomas Ordowski, Mar 15 2019

Examples

			For n = 2, p = prime(2) = 3, the least prime q different from 3 such that 2^(q-1) == 1 (mod 3) is a(2) = 5.
For n = 3, p = prime(3) = 5, the least prime q different from 5 such that 2^(q-1) == 1 (mod 5) is a(3) = 13.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local p,q,v,j;
      if n = 1 then return 0 fi;
      p:= ithprime(n);
      v:= numtheory:-order(2,p);
      for q from 1 by v do
        if q <> p and isprime(q) then return q fi
      od
    end proc:
    map(f, [$1..100]); # Robert Israel, Mar 17 2019
  • PARI
    A321992(n)={if(2