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.

A378387 a(n) is the number of proper divisors d of n such that (-d)^n == -d (mod n).

Original entry on oeis.org

0, 1, 1, 0, 1, 2, 1, 0, 1, 1, 1, 1, 1, 1, 2, 0, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 0, 2, 1, 1, 0, 1, 1, 2, 0, 1, 3, 1, 1, 2, 1, 1, 0, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 0, 3, 4, 1, 0, 2, 4, 1, 1, 1, 1, 2, 1, 1, 2, 1, 0, 1, 1, 1, 0, 2, 1, 2, 0, 1, 2, 2, 1, 2, 1, 2, 1, 1, 1, 1, 0
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Dec 23 2024

Keywords

Comments

From Robert Israel, Dec 27 2024: (Start)
If n > 1 is odd, a(n) > 0 as d = 1 works.
a(n) = 1 if n is a prime power (A246655). (End)

Examples

			a(4) = 0 because the proper divisors of 4 are 1, 2 and
(-1)^4 (mod 4) is not congruent to 3 (mod 4);
(-2)^4 (mod 4) is not congruent to 2 (mod 4).
a(5) = 1 because the only proper divisor of 5 is 1 and
(-1)^5 (mod 5) == 4 (mod 5).
		

Crossrefs

Programs

  • Magma
    [#[d: d in [1..n-1] | n mod d eq 0 and (-d)^n mod n eq n-d]: n in [1..100]];
  • Maple
    f:= proc(n) nops(select((t -> (-t)&^n + t mod n = 0), numtheory:-divisors(n) minus {n})) end proc:
    map(f, [$1..100]); # Robert Israel, Dec 27 2024
  • Mathematica
    a[n_] := DivisorSum[n, 1 &, # < n && PowerMod[n - #, n, n] == n - # &]; Array[a, 100] (* Amiram Eldar, Dec 23 2024 *)

Extensions

Edited by N. J. A. Sloane, Jan 11 2025