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.

A242345 Number of primes p < prime(n) with p and 2^p - p both primitive roots modulo prime(n).

This page as a plain text file.
%I A242345 #16 Aug 05 2019 04:41:24
%S A242345 0,1,1,1,1,1,3,1,1,1,1,2,2,1,4,4,7,1,2,1,1,1,6,4,1,4,2,6,3,7,1,3,7,4,
%T A242345 6,1,5,6,9,12,7,5,6,4,11,2,3,6,12,6,18,13,3,14,13,14,15,4,9,6,3,13,8,
%U A242345 12,5,12,6,6,20,8,14,19,8,5,5,22,20,6,18,6
%N A242345 Number of primes p < prime(n) with p and 2^p - p both primitive roots modulo prime(n).
%C A242345 Conjecture: a(n) > 0 for all n > 1. In other words, for any odd prime p, there is a prime q < p such that both q and 2^q - q are primitive roots modulo p.
%C A242345 According to page 377 in Guy's book, Erdős asked whether for any sufficiently large prime p there exists a prime q < p which is a primitive root modulo p.
%D A242345 R. K. Guy, Unsolved Problems in Number Theory, 3rd Edition, Springer, New York, 2004.
%H A242345 Zhi-Wei Sun, <a href="/A242345/b242345.txt">Table of n, a(n) for n = 1..3500</a>
%H A242345 Zhi-Wei Sun, <a href="http://arxiv.org/abs/1405.0290">Notes on primitive roots modulo primes</a>, arXiv:1405.0290 [math.NT], 2014.
%e A242345 a(4) = 1 since 3 is a prime smaller than prime(4) = 7, and both 3 and 2^3 - 3 = 5 are primitive roots modulo 7.
%e A242345 a(10) = 1 since 2 is a prime smaller than prime(10) = 29, and 2 and 2^2 - 2 are primitive roots modulo 29.
%e A242345 a(36) = 1 since 71 is a prime smaller than prime(36) = 151, and both 71 and 2^(71) - 71 ( == 14 (mod 151)) are primitive roots modulo 151.
%t A242345 f[k_]:=2^(Prime[k])-Prime[k]
%t A242345 dv[n_]:=Divisors[n]
%t A242345 Do[m=0;Do[If[Mod[f[k],Prime[n]]==0,Goto[aa],Do[If[Mod[(Prime[k])^(Part[dv[Prime[n]-1],i]),Prime[n]]==1||Mod[f[k]^(Part[dv[Prime[n]-1],i]),Prime[n]]==1,Goto[aa]],{i,1,Length[dv[Prime[n]-1]]-1}]];m=m+1;Label[aa];Continue,{k,1,n-1}];
%t A242345 Print[n," ",m];Continue,{n,1,80}]
%Y A242345 Cf. A000040, A000325, A234972, A236966, A242248, A242250, A242292.
%K A242345 nonn
%O A242345 1,7
%A A242345 _Zhi-Wei Sun_, May 11 2014