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

Original entry on oeis.org

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, 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, 19, 10, 12, 7, 21, 5, 15, 19, 15
Offset: 1

Views

Author

Zhi-Wei Sun, May 08 2014

Keywords

Comments

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

Examples

			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.
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.
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.
		

Programs

  • Mathematica
    rMod[m_,n_]:=Mod[Numerator[m]*PowerMod[Denominator[m],-1,n],n,-n/2]
    f[k_]:=HarmonicNumber[Prime[k]-1]
    dv[n_]:=Divisors[n]
    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}]