A242193 Least prime p such that B_{2*n} == 0 (mod p) but there is no k < n with B_{2k} == 0 (mod p), or 1 if such a prime p does not exist, where B_m denotes the m-th Bernoulli number.
1, 1, 1, 1, 5, 691, 7, 3617, 43867, 283, 11, 103, 13, 9349, 1721, 37, 17, 26315271553053477373, 19, 137616929, 1520097643918070802691, 59, 23, 653, 417202699, 577, 39409, 113161, 29, 2003, 31, 1226592271, 839, 101, 688531
Offset: 1
Keywords
Examples
a(14) = 9349 since the numerator of |B_{28}| is 7*9349*362903 with B_2*B_4*B_6*...*B_{26} not congruent to 0 modulo 9349, but B_{14} == 0 (mod 7).
Links
- Peter Luschny, Table of n, a(n) for n = 1..103, (a(1)..a(60) from Zhi-Wei Sun)
- Z.-W. Sun, New observations on primitive roots modulo primes, arXiv preprint arXiv:1405.0290 [math.NT], 2014.
Programs
-
Mathematica
b[n_]:=Numerator[Abs[BernoulliB[2n]]] f[n_]:=FactorInteger[b[n]] p[n_]:=Table[Part[Part[f[n],k],1],{k,1,Length[f[n]]}] Do[If[b[n]<2,Goto[cc]];Do[Do[If[Mod[b[i],Part[p[n],k]]==0,Goto[aa]],{i,1,n-1}];Print[n," ",Part[p[n],k]];Goto[bb];Label[aa];Continue,{k,1,Length[p[n]]}];Label[cc];Print[n," ",1];Label[bb];Continue,{n,1,35}] (* Second program: *) LPDtransform[n_, fun_] := Module[{d}, d[p_] := AllTrue[Range[n - 1], !Divisible[fun[#], p]&]; SelectFirst[FactorInteger[fun[n]][[All, 1]], d] /. Missing[_] -> 1]; A242193list[sup_] := Table[LPDtransform[n, Function[k, Abs[BernoulliB[2k]] // Numerator]], {n, 1, sup}] A242193list[35] (* Jean-François Alcover, Jul 27 2019, after Peter Luschny *)
-
Sage
def LPDtransform(n, fun): d = lambda p: all(not p.divides(fun(k)) for k in (1..n-1)) return next((p for p in prime_divisors(fun(n)) if d(p)), 1) A242193list = lambda sup: [LPDtransform(n, lambda k: abs(bernoulli(2*k)).numerator()) for n in (1..sup)] print(A242193list(35)) # Peter Luschny, Jul 26 2019
Comments