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.

Showing 1-3 of 3 results.

A065295 Number of values of s, 0 < s <= n-1, such that s^s == s (mod n).

Original entry on oeis.org

0, 1, 1, 2, 1, 4, 2, 4, 3, 4, 1, 7, 2, 5, 7, 6, 3, 8, 2, 9, 7, 5, 2, 13, 5, 8, 3, 11, 2, 14, 3, 6, 8, 8, 9, 13, 2, 7, 9, 17, 5, 18, 3, 11, 13, 5, 2, 19, 9, 12, 11, 13, 1, 8, 11, 18, 9, 7, 1, 27, 4, 7, 20, 10, 16, 18, 3, 13, 8, 21, 2, 23, 5, 6, 16, 14, 13, 23, 4, 27, 9, 11, 1, 31, 13, 10, 12, 20
Offset: 1

Views

Author

Jonathan Ayres (jonathan.ayres(AT)btinternet.com), Oct 28 2001

Keywords

Comments

Note that a(1) = 0 by definition. - Harry J. Smith, Oct 15 2009

Examples

			For n=5 we have (1^1) mod 5 = 1, (2^2) mod 5 = 4, (3^3) mod 5 = 2, (4^4) mod 5 = 1. Only for s=1 does (s^s) mod 5=s, so a(5)=1.
		

Crossrefs

Cf. A065296.

Programs

  • Maple
    a:= n-> add(`if`(s&^s-s mod n=0, 1, 0), s=1..n-1):
    seq(a(n), n=1..88);  # Alois P. Heinz, Jun 09 2025
  • Mathematica
    f[p_] := Module[{x = Range[p-1]}, Count[PowerMod[x, x, p] - x, 0]]; Table[f[n], {n, 100}] (* T. D. Noe, Feb 19 2014 *)
  • PARI
    { for (n=1, 1000, a=0; for (s=1, n - 1, if (s^s % n == s, a++)); if (n==1, a=0); write("b065295.txt", n, " ", a) ) } \\ Harry J. Smith, Oct 15 2009
    
  • PARI
    a(n) = sum(s=1, n-1, Mod(s, n)^s == s); \\ Michel Marcus, Jun 03 2025

Extensions

Definition revised by N. J. A. Sloane, Oct 15 2009.

A233518 Primes p such that x^x == x (mod p) for some number x with 1 < x < p.

Original entry on oeis.org

7, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 61, 67, 71, 73, 79, 89, 97, 101, 103, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 181, 191, 193, 197, 199, 211, 223, 229, 233, 239, 241, 251, 257, 263, 271, 277, 281, 283, 307, 311, 313, 331, 337
Offset: 1

Views

Author

T. D. Noe, Feb 18 2014

Keywords

Comments

Complement of A065296.

Crossrefs

Programs

  • Mathematica
    fQ[p_] := Min[Table[Mod[PowerMod[x, x, p] - x, p], {x, 2, p - 1}]] == 0; Select[Prime[Range[2, 100]], fQ[#] &]

A338128 a(n) is the least k > 1 such that the base n representation of k^k ends with that of k.

Original entry on oeis.org

3, 4, 3, 6, 3, 4, 3, 4, 5, 12, 3, 5, 4, 5, 5, 9, 4, 7, 5, 4, 11, 12, 3, 6, 5, 10, 4, 17, 5, 16, 9, 11, 9, 13, 4, 10, 7, 5, 5, 9, 4, 7, 11, 9, 12, 24, 5, 8, 6, 9, 5, 54, 10, 11, 7, 7, 17, 60, 5, 13, 16, 4, 9, 5, 11, 37, 9, 12, 13, 36, 7, 37, 10, 6, 7, 16, 5, 27
Offset: 2

Views

Author

Rémy Sigrist, Oct 11 2020

Keywords

Examples

			a(10) = A082576(2) = 5.
		

Crossrefs

Programs

  • PARI
    a(n) = for (k=2, oo, if (Mod(k, n^#digits(k,n))^k==k, return (k)))

Formula

a(n) <= n+1 with equality iff n belongs to A065296.
Showing 1-3 of 3 results.