login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A336016
a(n) is the number of primes q less than primorial(n) having k = 2 as the least exponent such that q^k == 1 (mod primorial(n)).
2
0, 1, 3, 5, 8, 19, 22, 51, 89, 145, 263, 453, 851, 1575, 2880, 5469, 10338, 19115, 35782, 67569, 128601, 243600, 463840, 883589
OFFSET
1,3
COMMENTS
a(n) = length of row n of A336015 for n > 1.
EXAMPLE
a(4) = 5 as there are 5 primes q coprime to primorial(4) = 210 such that 2 is the least positive integer exponent k where q^k == 1 (mod 210). Those primes are 29, 41, 71, 139, 181 and indeed we have 29^2 == 1 (mod 210), 41^2 == 1 (mod 210), 71^2 == 1 (mod 210), 139^2 == 1 (mod 210) and 181^2 == 1 (mod 210) and no more below 210. So as these are five such primes in row 4, a(4) = 5. - David A. Corneth, Aug 15 2020
MATHEMATICA
Table[Block[{P = #, k = 0}, Do[If[MultiplicativeOrder[Prime@ i, P] == 2, k++], {i, PrimePi[n + 1], PrimePi[P - 1]}]; k] &@ Product[Prime@ j, {j, n}], {n, 8}]
PROG
(PARI) a(n) = {if(n <= 2, return(n-1)); my(pp = vecprod(primes(n))/2, d = divisors(pp), res = 0); for(i = 1, #d, c = lift(chinese(Mod(-1, d[i]), Mod(1, pp/d[i]))); forstep(i = c, pp*2, pp, if(isprime(i), res++ ) ) ); res } \\ David A. Corneth, Aug 16 2020
CROSSREFS
KEYWORD
nonn,more
EXTENSIONS
New name from David A. Corneth, Aug 15 2020
STATUS
approved