A066340 Fermat's triangle: T(n,m) = m^phi(n) mod n; n >= 2; 1 <= m <= n-1, where phi is Euler's totient function.
1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 4, 3, 4, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 6, 1, 6, 5, 6, 1, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 9, 4, 1, 0, 1, 4, 9, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, 1, 8, 1, 8, 7, 8, 1, 8, 1, 8, 1, 1, 1, 6, 1, 10, 6, 1, 1, 6, 10, 1, 6, 1, 1
Offset: 2
Examples
Triangle begins: 1; 1, 1; 1, 0, 1; 1, 1, 1, 1; 1, 4, 3, 4, 1; 1, 1, 1, 1, 1, 1; 1, 0, 1, 0, 1, 0, 1; 1, 1, 0, 1, 1, 0, 1, 1; 1, 6, 1, 6, 5, 6, 1, 6, 1; 1, 1, 1, 1, 1, 1, 1, 1, 1, 1; 1, 4, 9, 4, 1, 0, 1, 4, 9, 4, 1; 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1; 1, 8, 1, 8, 1, 8, 7, 8, 1, 8, 1, 8, 1; 1, 1, 6, 1, 10, 6, 1, 1, 6, 10, 1, 6, 1, 1;
Links
- Alois P. Heinz, Rows n = 2..201, flattened
Crossrefs
Cf. A000010.
Programs
-
Mathematica
Table[PowerMod[ #, EulerPhi[n], n]&/@ Range[n-1], {n, 2, 32} ]
-
PARI
T(n,k) = lift(Mod(k, n)^eulerphi(n)); tabl(nn) = for (n=2, nn, for (k=1, n-1, print1(T(n,k), ", ")); print); \\ Michel Marcus, Aug 13 2019
Comments