login
a(n) is the smallest prime with at least n consecutive primitive roots.
1

%I #15 Aug 23 2019 11:55:28

%S 2,5,11,37,53,83,83,269,269,467,467,1187,1559,1559,1559,6803,6803,

%T 6803,10559,10559,10559,35279,38639,38639,38639,38639,38639

%N a(n) is the smallest prime with at least n consecutive primitive roots.

%e a(4)=37. 37 has the primitive roots 2, 5, 13, 15, 17, 18, 19, 20, 22, 24, 32, and 35 of which 17, 18, 19, and 20 are consecutive.

%t PrimRoot[n_] :=Flatten[Position[Table[MultiplicativeOrder[i, n], {i, n - 1}],n - 1]];t = {};For[targ = 1, targ <= 22, targ++,flag = 0; For[n = 1, n < 1500, n++,prs = PrimRoot[Prime[n]];numprs = EulerPhi[Prime[n] - 1]; If[targ > numprs, ,For[m = 1, m <= numprs + 1 - targ, m++,temp = Take[prs, {m, m + targ - 1}];If[temp[[1]] + targ - 1 == temp[[targ]] && flag == 0,t = Append[t, Prime[n]]; flag = 1];If[flag == 1, Break[]];]; If[flag == 1, Break[]];];If[flag == 1, Break[]];]]; t

%t Join[{2},Module[{prl=Table[{p,Max[Length/@Select[Split[ Differences[ PrimitiveRootList[ p]]], #[[1]]==1&]]},{p,Prime[Range[1500]]}]},Table[ SelectFirst[ prl, #[[2]]>=k&],{k,20}]][[All, 1]]] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Aug 23 2019 *)

%Y Cf. A060749, A261438 (has "exactly" instead of "at least").

%K nonn,more

%O 1,1

%A _Dimitri Papadopoulos_, Feb 03 2016

%E More terms from _Harvey P. Dale_, Aug 23 2019