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.

This page as a plain text file.
%I A215935 #20 Jan 08 2022 21:11:29
%S A215935 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,
%T A215935 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,
%U A215935 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
%N 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.
%C A215935 If n in A056867 then a(n) = 0.
%H A215935 Alois P. Heinz, <a href="/A215935/b215935.txt">Table of n, a(n) for n = 1..10000</a>
%e A215935 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.
%p A215935 a:= proc(n) local l; l:= ifactors(n)[2];
%p A215935        add(add(`if`(irem(i[1]^i[2], j[1])=1, 1, 0), i=l), j=l)
%p A215935     end:
%p A215935 seq (a(n), n=1..100);  # _Alois P. Heinz_, Aug 28 2012
%t A215935 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 *)
%o A215935 (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))
%Y A215935 Cf. A054395, A056867.
%K A215935 nonn
%O A215935 1,12
%A A215935 _Charles R Greathouse IV_, Aug 27 2012