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.

This page as a plain text file.
%I A321992 #38 Dec 15 2024 04:35:32
%S A321992 0,5,13,13,31,37,41,37,67,113,11,73,61,29,139,157,233,181,199,211,19,
%T A321992 157,739,23,193,401,307,743,37,29,29,521,409,277,593,31,53,487,499,
%U A321992 1033,1069,541,571,97,1373,397,421,149,1583,457,59,953,73,101,17,787,1609,541,461
%N 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.
%C A321992 a(n) = 0 only for n = 1, p = 2. For any odd prime, a prime q meeting the requirement does exist.
%C A321992 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
%H A321992 Robert Israel, <a href="/A321992/b321992.txt">Table of n, a(n) for n = 1..10000</a> (a(1) = 0 inserted by Georg Fischer, May 05 2019)
%e A321992 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.
%e A321992 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.
%p A321992 f:= proc(n) local p,q,v,j;
%p A321992   if n = 1 then return 0 fi;
%p A321992   p:= ithprime(n);
%p A321992   v:= numtheory:-order(2,p);
%p A321992   for q from 1 by v do
%p A321992     if q <> p and isprime(q) then return q fi
%p A321992   od
%p A321992 end proc:
%p A321992 map(f, [$1..100]); # _Robert Israel_, Mar 17 2019
%o A321992 (PARI) A321992(n)={if(2<n=prime(n),forprime(q=2,,Mod(2,n)^(q-1)==1 && q!=n && return(q)),0)}
%Y A321992 Cf. A002326, A014664, A065091.
%K A321992 nonn,look
%O A321992 1,2
%A A321992 _M. F. Hasler_, Mar 15 2019