OFFSET
1,3
COMMENTS
Of course for any n, k being equal to either 1 or n-1 would work.
LINKS
Seiichi Manyama, Table of n, a(n) for n = 1..10000
MAPLE
a:= n-> add(`if`(k&^(n-k)+(n-k)&^k mod n=0, 1, 0), k=1..n-1):
seq(a(n), n=1..100); # Alois P. Heinz, Aug 06 2021
MATHEMATICA
f[n_] := Block[{c = 0, k = 1}, While[k < n, If[ Mod[ PowerMod[k, n - k, n] + PowerMod[n - k, k, n], n] == 0, c++]; k++]; c]; Array[f@# &, 100]
PROG
(Python)
def a(n): return sum((k**(n-k) + (n-k)**k)%n == 0 for k in range(1, n))
print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Jul 31 2021
(PARI) a(n) = sum(k=1, n-1, Mod(k, n)^(n-k) + Mod(n-k, n)^k == 0); \\ Michel Marcus, Aug 06 2021
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Robert G. Wilson v, Jul 31 2021
STATUS
approved