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.

A242213 Least prime p < prime(n) such that the Bernoulli number B_{p-1} is a primitive root modulo prime(n), or 0 if such a prime p does not exist.

Original entry on oeis.org

0, 0, 2, 2, 3, 2, 3, 17, 2, 2, 7, 2, 3, 19, 2, 2, 3, 2, 17, 2, 7, 2, 3, 3, 13, 2, 2, 3, 3, 3, 3, 3, 3, 5, 2, 3, 3, 7, 2, 2, 3, 2, 2, 5, 2, 2, 5, 3, 3, 3, 3, 2, 7, 3, 3, 2, 2, 2, 3, 5, 11, 2, 13, 2, 11, 2, 5, 17, 3, 2
Offset: 1

Views

Author

Zhi-Wei Sun, May 07 2014

Keywords

Comments

According to the conjecture in A242210, a(n) should be positive for all n > 2.

Examples

			a(7) = 3 since 3 is a primitive root modulo prime(7) = 17 but 2 is not.
		

Crossrefs

Programs

  • Mathematica
    rMod[m_,n_]:=Mod[Numerator[m]*PowerMod[Denominator[m],-1,n],n,-n/2]
    f[k_]:=BernoulliB[Prime[k]-1]
    dv[n_]:=Divisors[n]
    Do[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}];Print[n," ",Prime[k]];Goto[bb];Label[aa];Continue,{k,1,n-1}];Print[n," ",0];Label[bb];Continue,{n,1,70}]