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.

A385638 Number of nonnegative s < n such that (-s)^s == -s^s (mod n).

Original entry on oeis.org

1, 2, 1, 3, 2, 3, 3, 7, 5, 5, 5, 7, 6, 7, 7, 14, 8, 11, 9, 11, 10, 11, 11, 15, 14, 13, 17, 15, 14, 15, 15, 30, 16, 17, 17, 23, 18, 19, 19, 23, 20, 21, 21, 23, 23, 23, 23, 31, 27, 29, 25, 27, 26, 35, 27, 31, 28, 29, 29, 31, 30, 31, 32, 62, 32, 33, 33, 35, 34, 35, 35, 47
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Aug 06 2025

Keywords

Comments

Every odd s < n satisfies the condition. An even s works only when n divides 2*s^s. Thus a(n) = floor(n/2) plus the even s that satisfy this test. For an odd prime p >= 3, no even s works, so a(p) = (p - 1) / 2. With 0^0 = 1, s = 0 works only for n = 1 or 2. - Robert P. P. McKone, Aug 07 2025

Crossrefs

Programs

A385662 Number of divisors d of n such that d^d == (-d)^d (mod n).

Original entry on oeis.org

1, 2, 1, 2, 1, 3, 1, 3, 2, 3, 1, 4, 1, 3, 1, 4, 1, 5, 1, 4, 1, 3, 1, 6, 2, 3, 3, 4, 1, 5, 1, 5, 1, 3, 1, 6, 1, 3, 1, 6, 1, 5, 1, 4, 2, 3, 1, 8, 2, 5, 1, 4, 1, 7, 1, 6, 1, 3, 1, 8, 1, 3, 2, 6, 1, 5, 1, 4, 1, 5, 1, 9, 1, 3, 2, 4, 1, 5, 1, 8, 3, 3, 1, 8, 1, 3, 1, 6, 1, 8, 1, 4, 1, 3, 1, 10, 1, 5, 2, 6
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Aug 03 2025

Keywords

Comments

From Robert Israel, Aug 04 2025: (Start)
If n is divisible by 4, a(n) = A000005(n/2).
If n is odd, a(n) is the number of divisors d of n such that n divides d^d.
If n = 2 * m with m odd, a(n) = A000005(m) + a(m). (End)

Crossrefs

Programs

  • Magma
    [1 + #[d: d in [1..n-1] | n mod d eq 0 and Modexp(d,d,n) eq Modexp(-d,d,n)]: n in [1..100]];
    
  • Maple
    f:= proc(n) if n::odd then nops(select(d -> d &^ d mod n = 0, numtheory:-divisors(n)))
           elif n mod 4 = 0 then numtheory:-tau(n/2)
           else numtheory:-tau(n/2) + procname(n/2) fi
    end proc:
    map(f, [$1..100]); # Robert Israel, Aug 04 2025
  • Mathematica
    a[n_] := DivisorSum[n, 1 &, PowerMod[#, #, n] == PowerMod[-#, #, n] &]; Array[a, 100] (* Amiram Eldar, Aug 04 2025 *)
  • PARI
    a(n) = sumdiv(n, d, Mod(d, n)^d == Mod(-d, n)^d); \\ Michel Marcus, Aug 04 2025

A386872 Smallest k for which A385662(k) = n, or -1 if no such k exists.

Original entry on oeis.org

1, 2, 6, 12, 18, 24, 54, 48, 72, 96, 270, 120, 450, 384, 288, 240, 2310, 360, 1890, 480, 1152, 3150, 4050, 720, 2592, 6930, 1800, 1920, 17010, 1440
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Aug 06 2025

Keywords

Crossrefs

Programs

  • PARI
    f(n) = sumdiv(n, d, Mod(d, n)^d == Mod(-d, n)^d); \\ A385662
    a(n) = my(k=1); while (f(k) != n, k++); k; \\ Michel Marcus, Aug 06 2025
Showing 1-3 of 3 results.