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.
%I A105874 #37 Mar 31 2024 14:59:14 %S A105874 5,7,13,23,29,37,47,53,61,71,79,101,103,149,167,173,181,191,197,199, %T A105874 239,263,269,271,293,311,317,349,359,367,373,383,389,421,461,463,479, %U A105874 487,503,509,541,557,599,607,613,647,653,661,677,701,709,719,743,751,757,773,797 %N A105874 Primes for which -2 is a primitive root. %C A105874 Also primes for which (p-1)/2 (==-1/2 mod p) is a primitive root. [_Joerg Arndt_, Jun 27 2011] %H A105874 Joerg Arndt, <a href="/A105874/b105874.txt">Table of n, a(n) for n = 1..10000</a> %H A105874 L. J. Goldstein, <a href="http://www.jstor.org/stable/2316895">Density questions in algebraic number theory</a>, Amer. Math. Monthly, 78 (1971), 342-349. %H A105874 <a href="/index/Pri#primes_root">Index entries for primes by primitive root</a> %F A105874 Let a(p,q)=sum(n=1,2*p*q,2*cos(2^n*Pi/((2*q+1)*(2*p+1)))). Then 2*p+1 is a prime belonging to this sequence when a(p,1)==1. - _Gerry Martens_, May 21 2015 %p A105874 with(numtheory); f:=proc(n) local t1,i,p; t1:=[]; for i from 1 to 500 do p:=ithprime(i); if order(n,p) = p-1 then t1:=[op(t1),p]; fi; od; t1; end; f(-2); %t A105874 pr=-2; Select[Prime[Range[200]], MultiplicativeOrder[pr, # ] == #-1 &] (* _N. J. A. Sloane_, Jun 01 2010 *) %t A105874 a[p_,q_]:=Sum[2 Cos[2^n Pi/((2 q+1) (2 p+1))], {n,1,2 q p}]; %t A105874 Select[Range[400], Reduce[a[#, 1] == 1, Integers] &]; %t A105874 2 % + 1 (* _Gerry Martens_, Apr 28 2015 *) %o A105874 (PARI) forprime(p=3,10^4,if(p-1==znorder(Mod(-2,p)),print1(p", "))); /* _Joerg Arndt_, Jun 27 2011 */ %o A105874 (Python) %o A105874 from sympy import n_order, nextprime %o A105874 from itertools import islice %o A105874 def A105874_gen(startvalue=3): # generator of terms >= startvalue %o A105874 p = max(startvalue-1,2) %o A105874 while (p:=nextprime(p)): %o A105874 if n_order(-2,p) == p-1: %o A105874 yield p %o A105874 A105874_list = list(islice(A105874_gen(),20)) # _Chai Wah Wu_, Aug 11 2023 %Y A105874 Cf. A001122, A019334-A019338, A001913, A019339-A019367 etc., A105875-A105914. %K A105874 nonn %O A105874 1,1 %A A105874 _N. J. A. Sloane_, Apr 24 2005