OFFSET
1,2
COMMENTS
If a(n) = n then 2*n-1 is prime or Fermat pseudoprime to base 2.
MATHEMATICA
a[n_] := PowerMod[n, 2*n - 1, 2*n - 1]; Array[a, 100] (* Amiram Eldar, Jul 23 2022 *)
PROG
(PARI) a(n)=n^(2*n-1)%(2*n-1)
(PARI) a(n)=lift(Mod(n, 2*n-1)^(2*n-1)) \\ Rémy Sigrist, Jul 21 2022
(Python)
def a(n): return pow(n, 2*n-1, 2*n-1)
print([a(n) for n in range(1, 70)]) # Michael S. Branicky, Jul 23 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Jonas Kaiser, Jul 20 2022
STATUS
approved