login
A355486
a(n) is the number of total solutions (minus the n-th prime) to x^y == y^x (mod p) where 0 < x,y <= p and p is the n-th prime.
2
0, 0, 2, 10, 10, 16, 22, 40, 56, 48, 70, 64, 66, 74, 114, 130, 118, 122, 138, 168, 220, 174, 158, 270, 242, 242, 234, 212, 238, 308, 284, 272, 334, 296, 318, 332, 424, 364, 368, 416, 370, 470, 524, 510, 464, 474, 552, 542, 480, 604, 586, 554, 768, 578, 752, 618, 628, 880, 752, 634, 702, 606, 846
OFFSET
1,3
FORMULA
a(n) = A355419(n) - A000040(n).
a(n) = 2*(number of solutions to x^y == y^x (mod p) where 1 < x < y < p). - Chai Wah Wu, Aug 30 2022
MAPLE
f:= proc(n) local p, x, y, t;
p:= ithprime(n);
t:= 0;
for x from 2 to p-1 do
for y from x+1 to p-1 do
if x&^y - y&^x mod p = 0 then t:= t+1 fi
od od:
2*t
end proc:
map(f, [$1..100]); # Robert Israel, Aug 31 2022
PROG
(Python)
from sympy import prime
def f(n):
S = 0
for x in range(1, n + 1):
for y in range(x + 1 , n + 1):
if ((pow(x, y, n) == pow(y, x, n))):
S += 2
return S
def a(n): return f(prime(n))
(Python)
from sympy import prime
def A355486(n):
p = prime(n)
return sum(2 for x in range(2, p-1) for y in range(x+1, p) if pow(x, y, p)==pow(y, x, p)) # Chai Wah Wu, Aug 30 2022
CROSSREFS
Sequence in context: A066556 A156556 A071808 * A168381 A212621 A156780
KEYWORD
nonn
AUTHOR
Darío Clavijo, Jul 04 2022
EXTENSIONS
More terms from Robert Israel, Aug 31 2022
STATUS
approved