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.

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.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

If n in A056867 then a(n) = 0.

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.
		

Crossrefs

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