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.

A242222 Number of primes p <= (prime(n)+1)/2 such that the harmonic number H(p-1) = sum_{0 is a primitive root modulo prime(n), or 0 if such a prime p does not exist.

This page as a plain text file.
%I A242222 #14 Aug 05 2019 04:40:33
%S A242222 0,0,0,1,1,1,3,1,1,1,2,3,4,4,5,6,3,2,3,2,3,2,6,6,4,6,4,8,7,9,5,7,11,5,
%T A242222 11,5,6,6,11,8,12,7,8,9,8,11,7,13,18,8,18,14,8,9,14,18,17,7,14,11,9,
%U A242222 19,10,12,7,21,5,15,19,15
%N A242222 Number of primes p <= (prime(n)+1)/2 such that the harmonic number H(p-1) = sum_{0<k<p} 1/k is a primitive root modulo prime(n), or 0 if such a prime p does not exist.
%C A242222 Conjecture: a(n) > 0 for all n > 3. In other words, for any prime p > 5, there exists a prime q <= (p+1)/2 such that the harmonic number H(q-1) = sum_{0<k<q}1/k is a primitive root modulo p.
%H A242222 Zhi-Wei Sun, <a href="/A242222/b242222.txt">Table of n, a(n) for n = 1..700</a>
%H A242222 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 A242222 a(6) = 1 since 7 is a prime not exceeding (prime(6)+1)/2 = 7, and H(7-1) = 49/20 == -6 (mod 13) with -6 a primitive root modulo prime(6) = 13.
%e A242222 a(8) = 1 since 5 is a prime not exceeding (prime(8)+1)/2 = 10, and H(5-1) = 25/12 == -9 (mod 19) with -9 a primitive root modulo prime(8) = 19.
%e A242222 a(9) = 1 since 11 is a prime not exceeding (prime(9)+1)/2 = 12, and H(11-1) = 7381/2520 == -9 (mod 23) with -9 a primitive root modulo prime(9) = 23.
%t A242222 rMod[m_,n_]:=Mod[Numerator[m]*PowerMod[Denominator[m],-1,n],n,-n/2]
%t A242222 f[k_]:=HarmonicNumber[Prime[k]-1]
%t A242222 dv[n_]:=Divisors[n]
%t A242222 Do[m=0;Do[If[rMod[f[k],Prime[n]]==0,Goto[aa]];Do[If[rMod[f[k]^(Part[dv[Prime[n]-1],i])-1,Prime[n]]==0,Goto[aa]],{i,1,Length[dv[Prime[n]-1]]-1}];m=m+1;Label[aa];Continue,{k,1,PrimePi[(Prime[n]+1)/2]}];Print[n," ",m];Continue,{n,1,70}]
%Y A242222 Cf. A000040, A001008, A002805, A242210, A242213, A242223.
%K A242222 nonn
%O A242222 1,7
%A A242222 _Zhi-Wei Sun_, May 08 2014