cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A355858 a(n) = n^(2*n-1) mod (2*n-1).

This page as a plain text file.
%I A355858 #48 Aug 24 2022 10:10:06
%S A355858 0,2,3,4,8,6,7,2,9,10,8,12,18,26,15,16,29,2,19,5,21,22,8,24,18,32,27,
%T A355858 32,50,30,31,8,63,34,26,36,37,32,30,40,80,42,8,11,45,32,35,22,49,35,
%U A355858 51,52,8,54,55,14,57,87,8,2,94,77,68,64,113,66,53,107,69
%N A355858 a(n) = n^(2*n-1) mod (2*n-1).
%C A355858 If a(n) = n then 2*n-1 is prime or Fermat pseudoprime to base 2.
%t A355858 a[n_] := PowerMod[n, 2*n - 1, 2*n - 1]; Array[a, 100] (* _Amiram Eldar_, Jul 23 2022 *)
%o A355858 (PARI) a(n)=n^(2*n-1)%(2*n-1)
%o A355858 (PARI) a(n)=lift(Mod(n, 2*n-1)^(2*n-1)) \\ _Rémy Sigrist_, Jul 21 2022
%o A355858 (Python)
%o A355858 def a(n): return pow(n, 2*n-1, 2*n-1)
%o A355858 print([a(n) for n in range(1, 70)]) # _Michael S. Branicky_, Jul 23 2022
%Y A355858 Cf. A000040, A001567, A006254, A085524, A174166, A179976.
%K A355858 nonn
%O A355858 1,2
%A A355858 _Jonas Kaiser_, Jul 20 2022