The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A359864 a(n) is the number of solutions to the congruence x^y == y^x (mod n) where 0 <= x,y <= n. 0
4, 3, 4, 7, 8, 9, 18, 19, 18, 17, 22, 27, 30, 31, 28, 67, 40, 37, 60, 55, 52, 57, 80, 87, 64, 73, 108, 85, 78, 75, 102, 239, 74, 97, 74, 115, 102, 125, 110, 191, 108, 123, 118, 151, 140, 149, 162, 331, 134, 133, 128, 201, 184, 217, 178, 299, 202, 163, 178, 251 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
a(n) is always greater than n.
LINKS
Project Euler, Problem 801: x^y == y^x, (2022)
FORMULA
a(n) = Sum_{x=0..n} Sum_{y=0..n} [x^y == y^x (mod n)].
PROG
(Python)
def a(n):
count = 0
for x in range(0, n + 1):
for y in range(0, n + 1):
if x == y or pow(x, y, n) == pow(y, x, n): count += 1
return count
(PARI) a(n) = sum(x=0, n, sum(y=0, n, Mod(x, n)^y == Mod(y, n)^x)); \\ Michel Marcus, Jan 16 2023
CROSSREFS
Cf. A355069.
Sequence in context: A200592 A021027 A289672 * A361849 A339409 A075246
KEYWORD
nonn
AUTHOR
Darío Clavijo, Jan 16 2023
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 13 21:51 EDT 2024. Contains 372523 sequences. (Running on oeis4.)