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-7 of 7 results.

A371513 a(n) is the smallest number m with n divisors d such that d^m mod m = d.

Original entry on oeis.org

1, 2, 6, 42, 30, 105, 910, 561, 1365, 5005, 5565, 11305, 36465, 140505, 239785, 41041, 682465, 873145, 185185, 418285, 1683969, 2113665, 5503785, 1242241, 6697405, 8549905, 31932901, 11996985, 31260405, 30534805, 47031061, 825265, 27265161, 32306365, 55336645, 21662641
Offset: 0

Views

Author

Juri-Stepan Gerasimov, Apr 10 2024

Keywords

Examples

			a(0) = 1 with divisors {};
a(1) = 2 with divisor {1};
a(2) = 6 with divisors {1, 3};
a(3) = 42 with divisors {1, 7, 21};
a(4) = 30 with divisors {1, 6, 10, 15};
a(5) = 105 with divisors {1, 7, 15, 21, 35};
a(6) = 910 with divisors {1, 35, 65, 91, 130, 455};
a(7) = 561 with divisors {1, 3, 11, 17, 33, 51, 187};
a(8) = 1365 with divisors {1, 13, 21, 91, 105, 195, 273, 455};
a(9) = 5005 with divisors {1, 11, 55, 65, 77, 143, 385, 715, 1001};
a(10) = 5565 with divisors {1, 7, 15, 21, 35, 105, 265, 371, 1113, 1855};
a(11) = 11305 with divisors {1, 17, 19, 35, 85, 119, 323, 595, 665, 1615, 2261}.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := DivisorSum[n, 1 &, PowerMod[#, n, n] == # &]; seq[max_] := Module[{t = Table[0, {max}], c = 0, n = 1, i}, While[c < max, i = f[n] + 1; If[i <= max && t[[i]] == 0, c++; t[[i]] = n]; n++]; t]; seq[18] (* Amiram Eldar, Apr 11 2024 *)
  • Python
    from sympy import divisors
    from itertools import count, islice
    def f(n, divs): return sum(1 for d in divs if pow(d, n, n) == d%n)
    def agen(verbose=False): # generator of terms
        adict, n = dict(), 0
        for k in count(1):
            divs = divisors(k)[1:]
            if len(divs) < n: continue
            v = f(k, divs)
            if v not in adict:
                adict[v] = k
                if verbose: print("FOUND", v, k)
            while n in adict: yield adict[n]; n += 1
    print(list(islice(agen(), 15))) # Michael S. Branicky, Apr 10 2024, updated Apr 17 2024 after Jon E. Schoenfield

Extensions

a(12)-a(25) from Michael S. Branicky, Apr 10 2024
a(26)-a(35) from Jon E. Schoenfield, Apr 10 2024

A371884 Irregular triangle read by rows in which row n >= 2 lists the divisors d of n such that d^n mod n = d.

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 5, 1, 1, 4, 1, 1, 7, 1, 5, 1, 1, 1, 9, 1, 1, 5, 1, 7, 1, 11, 1, 1, 1, 1, 13, 1, 1, 4, 1, 1, 6, 10, 15, 1, 1, 1, 11, 1, 17, 1, 1, 9, 1, 1, 19, 1, 13, 1, 1, 1, 7, 21, 1, 1, 1, 9, 1, 23, 1, 1, 16, 1, 1, 25, 1, 17, 1, 13, 1, 1, 27, 1, 11, 1, 8, 1, 19, 1, 29, 1, 1, 1, 1, 31, 1, 1, 1, 5, 13
Offset: 2

Views

Author

Juri-Stepan Gerasimov, Apr 10 2024

Keywords

Examples

			Triangle begins:
    1;
    1;
    1;
    1;
    1, 3;
    1;
    1;
    1;
    1, 5;
    1;
    1, 4;
    1;
    1, 7;
    1, 5;
    1;
    1;
    1, 9;
    1;
    1, 5;
    1, 7;
    1, 11;
    1;
    1;
    1;
    1, 13;
    1;
    1, 4;
    1;
    1, 6, 10, 15;
    ...
		

Crossrefs

Programs

  • Magma
    [[d: d in Divisors(n) | d^n mod n eq d]: n in [2..65]];
  • Maple
    f:= proc(n) op(sort(convert(select(d -> d^n mod n = d, numtheory:-divisors(n)),list))) end proc:
    for n from 2 to 100 do f(n) od; # Robert Israel, May 11 2025
  • Mathematica
    row[n_] := Select[Divisors[n], PowerMod[#, n, n] == # &]; Array[row, 64, 2] // Flatten (* Amiram Eldar, Apr 11 2024 *)

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

A372772 a(n) is the number of divisors d of n such that d^n mod n = k, where k is also a divisor of n.

Original entry on oeis.org

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

Views

Author

Juri-Stepan Gerasimov, May 12 2024

Keywords

Examples

			a(12) = 3: 1 divides 12, and 1^12 mod 12 = 1;
           2 divides 12, and 2^12 mod 12 = 4;
           3 divides 12, but 3^12 mod 12 = 9 (not a divisor of 12);
           4 divides 12, and 4^12 mod 12 = 4;
           6 divides 12, but 6^12 mod 12 = 0 (not a divisor of 12);
           12 divides 12, but 12^12 mod 12 = 0 (not a divisor of 12).
		

Crossrefs

Cf. A371883.

Programs

  • Magma
    [&+[#[d: d in Divisors(n) | d^n mod n eq k and n mod k eq 0]: k in [1..n]]: n in [1..100]];
    
  • Mathematica
    a[n_] := DivisorSum[n, 1 &, (m = PowerMod[#, n, n]) > 0 && Divisible[n, m] &]; Array[a, 100] (* Amiram Eldar, May 13 2024 *)
  • PARI
    A372772(n) = { my(k); sumdiv(n, d, k=lift(Mod(d^n,n)); k > 0 && 0==(n%k)); }; \\ Antti Karttunen, May 13 2024
    
  • Python
    from sympy import divisors
    def a(n):
        divs = set(divisors(n)[:-1])
        return sum(1 for d in divs if pow(d, n, n) in divs)
    print([a(n) for n in range(1, 101)]) # Michael S. Branicky, May 13 2024

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

Original entry on oeis.org

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

Views

Author

Juri-Stepan Gerasimov, Feb 03 2025

Keywords

Crossrefs

Programs

  • Magma
    [#[d: d in Divisors(n) | -d^n mod n eq d]: n in [1..100]];
  • Mathematica
    a[n_] := DivisorSum[n, 1 &, Mod[-PowerMod[#, n, n], n] == # &]; Array[a, 100] (* Amiram Eldar, Feb 04 2025 *)

A380858 a(n) is the number of primes p <= n such that p^(p + n) == p (mod p + n).

Original entry on oeis.org

0, 0, 2, 1, 2, 1, 1, 2, 1, 3, 2, 3, 1, 3, 2, 3, 2, 4, 1, 3, 1, 3, 1, 6, 0, 6, 1, 4, 2, 7, 1, 3, 0, 6, 3, 6, 1, 5, 2, 5, 2, 8, 1, 5, 1, 5, 1, 8, 0, 6, 2, 5, 1, 9, 0, 8, 1, 5, 3, 12, 1, 8, 1, 7, 2, 11, 1, 8, 2, 8, 2, 10, 1, 6, 0, 9, 1, 12, 1, 7, 1, 5, 1, 13, 0, 9, 3, 6, 1, 15
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Feb 06 2025

Keywords

Examples

			a(3) = 2 because 2^(2+3) = 32 mod (2+3) is equal to 2 and 3^(3+3) = 729 mod (3+3) is equal to 3;
a(4) = 1 because 2^(2+4) = 64 mod (2+4) is equal to 4, but not is equal to 2, and 3^(3+4) = 2187 mod (3+4) is equal to 3.
		

Crossrefs

Programs

A380833 a(n) is the number of divisors d of n satisfying (-d)^n mod n = d.

Original entry on oeis.org

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

Views

Author

Juri-Stepan Gerasimov, Feb 06 2025

Keywords

Crossrefs

Programs

  • Magma
    [#[d: d in Divisors(n) | (-d)^n mod n eq d]: n in [1..100]];
  • Mathematica
    a[n_] := DivisorSum[n, 1 &, PowerMod[-#, n, n] == # &]; Array[a, 100] (* Amiram Eldar, Feb 06 2025 *)
Showing 1-7 of 7 results.