login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A337632
Triangle read by rows: T(n,k) is the number of nonnegative integers m < n such that m^k - m == 0 (mod n), where 0 <= k < n.
3
1, 1, 2, 1, 3, 2, 1, 4, 2, 3, 1, 5, 2, 3, 2, 1, 6, 4, 6, 4, 6, 1, 7, 2, 3, 4, 3, 2, 1, 8, 2, 5, 2, 5, 2, 5, 1, 9, 2, 3, 4, 3, 2, 7, 2, 1, 10, 4, 6, 4, 10, 4, 6, 4, 10, 1, 11, 2, 3, 2, 3, 6, 3, 2, 3, 2, 1, 12, 4, 9, 4, 9, 4, 9, 4, 9, 4, 9, 1, 13, 2, 3, 4, 5, 2
OFFSET
1,3
LINKS
Peter Kagey, Table of n, a(n) for n = 1..10011 (first 141 rows, flattened)
FORMULA
T(n,k) = A334006(n,k) * A337633(n,k).
EXAMPLE
Triangle begins:
n\k| 0 1 2 3 4 5 6 7 8 9
---+--------------------------------
1 | 1;
2 | 1, 2;
3 | 1, 3, 2;
4 | 1, 4, 2, 3;
5 | 1, 5, 2, 3, 2;
6 | 1, 6, 4, 6, 4, 6;
7 | 1, 7, 2, 3, 4, 3, 2;
8 | 1, 8, 2, 5, 2, 5, 2, 5;
9 | 1, 9, 2, 3, 4, 3, 2, 7, 2;
10 | 1, 10, 4, 6, 4, 10, 4, 6, 4, 10;
...
T(10,2) = 4 because
0^2 - 0 == 0 (mod 10),
1^2 - 1 == 0 (mod 10),
5^2 - 5 == 0 (mod 10), and
6^2 - 6 == 0 (mod 10).
PROG
(Haskell)
a337632t n k = length $ filter (\m -> (m^k - m) `mod` n == 0) [0..n-1]
(PARI) T(n, k) = sum(m=0, n-1, Mod(m, n)^k == Mod(m, n)); \\ Michel Marcus, Sep 13 2020
(Magma) [[#[m: m in [0..n-1] | m^k mod n eq m]: k in [0..n-1]]: n in [1..17]]; // Juri-Stepan Gerasimov, Oct 12 2020
CROSSREFS
Sequence in context: A275724 A375025 A193278 * A057058 A334441 A278104
KEYWORD
nonn,tabl
AUTHOR
Peter Kagey, Sep 12 2020
STATUS
approved