A215935 Number of ordered pairs of primes (p, q) dividing n for which p^e = 1 mod q, where e is the exponent of p in n.
0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 2, 0, 0, 0, 1, 0, 2, 0, 1, 1, 1, 0, 3, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 1, 1, 2, 1, 1, 0, 3, 0, 1, 1, 0, 0, 2, 0, 1, 0, 2, 0, 1, 0, 1, 1, 1, 0, 3, 0, 2, 0, 1, 0, 4, 0, 1, 0, 1, 0, 2, 0, 1, 1
Offset: 1
Keywords
Examples
12 is divisible by two primes, 2 and 3. The exponent of 2 is 2 and the exponent of 3 is 1. 2^2 = 1 mod 3 and 3^1 = 1 mod 2, so a(12) = 2.
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..10000
Programs
-
Maple
a:= proc(n) local l; l:= ifactors(n)[2]; add(add(`if`(irem(i[1]^i[2], j[1])=1, 1, 0), i=l), j=l) end: seq (a(n), n=1..100); # Alois P. Heinz, Aug 28 2012
-
Mathematica
a[n_] := With[{f = FactorInteger[n]}, Sum[ Boole[ Mod[p[[1]]^p[[2]], q[[1]]] == 1], {p, f}, {q, f}]]; Table[a[n], {n, 1, 93}] (* Jean-François Alcover, Sep 03 2012 *)
-
PARI
a(n)=my(f=factor(n),k=#f~); sum(i=1,k, sum(j=1,k, i!=j && Mod(f[i,1],f[j,1])^f[i,2]==1))
Comments