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.

A337633 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.

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, 1, 2, 3, 2, 1, 2, 4, 2, 4, 2, 1, 1, 2, 1, 4, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 4, 1, 2, 1, 2, 1, 2, 4, 6, 4, 2, 4, 6, 4, 2, 1, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 2, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 1, 1, 2, 3, 4, 1, 2, 7, 2
Offset: 1

Views

Author

Peter Kagey, Sep 12 2020

Keywords

Examples

			Triangle begins:
  n\k| 0  1  2  3  4  5  6  7  8  9
  ---+-----------------------------
   1 | 1;
   2 | 1, 2;
   3 | 1, 1, 2;
   4 | 1, 2, 2, 1;
   5 | 1, 1, 2, 3, 2;
   6 | 1, 2, 4, 2, 4, 2;
   7 | 1, 1, 2, 1, 4, 1, 2;
   8 | 1, 2, 2, 1, 2, 1, 2, 1;
   9 | 1, 1, 2, 1, 4, 1, 2, 1, 2;
  10 | 1, 2, 4, 6, 4, 2, 4, 6, 4, 2;
...
T(10, 2) = 4 because
0^2 + 0 == 0 (mod 10),
4^2 + 4 == 0 (mod 10),
5^2 + 5 == 0 (mod 10), and
9^2 + 9 == 0 (mod 10).
		

Crossrefs

Programs

  • Haskell
    a337633t n k = length $ filter (\m -> (m^k + m) `mod` n == 0) [0..n-1]
    
  • 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

Formula

T(n,k) = A337632(n,k)/A334006(n,k).