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.

A290542 a(n) is the least integer k in the interval [2, sqrt(n)] such that k^n == k (mod n), or 0 if no such integer exists.

Original entry on oeis.org

0, 2, 0, 2, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 4, 2, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 5, 3, 2, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 4, 0, 0, 0, 2, 0
Offset: 4

Views

Author

Arkadiusz Wesolowski, Aug 05 2017

Keywords

Crossrefs

Programs

  • Magma
    lst:=[]; for n in [4..90] do r:=Floor(Sqrt(n)); for k in [2..r] do if Modexp(k, n, n) eq k then Append(~lst, k); break; end if; if k eq r then Append(~lst, 0); end if; end for; end for; lst;
    
  • Mathematica
    Table[SelectFirst[Range[2, Sqrt@ n], PowerMod[#, n , n] == Mod[#, n] &] /. k_ /; MissingQ@ k -> 0, {n, 4, 90}] (* Michael De Vlieger, Aug 09 2017 *)
  • PARI
    a(n) = for (k=2, sqrtint(n), if (Mod(k, n)^n == k, return(k));); return (0); \\ Michel Marcus, Aug 19 2017

Formula

a(A000040(n)) = 2 for n >= 3.
a(A001567(n)) = 2 for n >= 1.
a(A006935(n)) = 2 for n >= 2.
For n >= 3, a(x) = 2*A010051(x), where x = A000040(n).