|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
LINKS
|
|
|
FORMULA
|
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:
|
|
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
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
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|