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.
%I A372772 #22 May 27 2024 23:10:41 %S A372772 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, %T A372772 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, %U A372772 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 %N 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. %H A372772 Antti Karttunen, <a href="/A372772/b372772.txt">Table of n, a(n) for n = 1..16384</a> %e A372772 a(12) = 3: 1 divides 12, and 1^12 mod 12 = 1; %e A372772 2 divides 12, and 2^12 mod 12 = 4; %e A372772 3 divides 12, but 3^12 mod 12 = 9 (not a divisor of 12); %e A372772 4 divides 12, and 4^12 mod 12 = 4; %e A372772 6 divides 12, but 6^12 mod 12 = 0 (not a divisor of 12); %e A372772 12 divides 12, but 12^12 mod 12 = 0 (not a divisor of 12). %t A372772 a[n_] := DivisorSum[n, 1 &, (m = PowerMod[#, n, n]) > 0 && Divisible[n, m] &]; Array[a, 100] (* _Amiram Eldar_, May 13 2024 *) %o A372772 (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]]; %o A372772 (PARI) A372772(n) = { my(k); sumdiv(n, d, k=lift(Mod(d^n,n)); k > 0 && 0==(n%k)); }; \\ _Antti Karttunen_, May 13 2024 %o A372772 (Python) %o A372772 from sympy import divisors %o A372772 def a(n): %o A372772 divs = set(divisors(n)[:-1]) %o A372772 return sum(1 for d in divs if pow(d, n, n) in divs) %o A372772 print([a(n) for n in range(1, 101)]) # _Michael S. Branicky_, May 13 2024 %Y A372772 Cf. A371883. %K A372772 nonn %O A372772 1,6 %A A372772 _Juri-Stepan Gerasimov_, May 12 2024