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.

A384237 The number of divisors d of n such that d^d == d (mod n).

Original entry on oeis.org

1, 2, 2, 2, 2, 3, 2, 2, 2, 3, 2, 4, 2, 3, 3, 2, 2, 3, 2, 3, 3, 3, 2, 3, 2, 3, 2, 4, 2, 6, 2, 2, 3, 3, 2, 4, 2, 3, 3, 3, 2, 4, 2, 3, 3, 3, 2, 3, 2, 3, 3, 3, 2, 3, 3, 4, 3, 3, 2, 4, 2, 3, 3, 2, 4, 5, 2, 3, 3, 3, 2, 3, 2, 3, 3, 3, 2, 4, 2, 4, 2, 3, 2, 6, 3, 3, 3, 3, 2, 5, 3, 3, 3, 3, 3, 2, 2, 3, 2, 3
Offset: 1

Views

Author

Juri-Stepan Gerasimov, May 22 2025

Keywords

Examples

			a(2) = 2 because 1^1 = 1 (mod 2) and 2^2 = 2 == 0 (mod 2) where 1 and 2 are divisors of 2.
		

Crossrefs

Programs

  • Magma
    [1 + #[d: d in Divisors(n) | Modexp(d, d, n) eq d]: n in [1..100]];
    
  • Mathematica
    a[n_]:=1+Length[Select[Divisors[n],PowerMod[#,#,n]==# &]]; Array[a,100] (* Stefano Spezia, May 25 2025 *)
  • PARI
    a(n) = sumdiv(n, d, Mod(d,n)^d == d); \\ Michel Marcus, May 25 2025
    
  • Python
    from sympy import divisors
    def A384237(n): return 1+sum(1 for d in divisors(n,generator=True) if dChai Wah Wu, May 29 2025

Formula

a(n) = 1 + number of proper divisors d of n such that d^(d-1) == 1 (mod n/d). - Chai Wah Wu, May 29 2025