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

A048154 Triangular array T read by rows: T(n,k)=k^3 mod n, for k=1,2,...,n, n=1,2,...

Original entry on oeis.org

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

Views

Author

Keywords

Examples

			Rows:
{0};
{1, 0};
{1, 2, 0};
{1, 0, 3, 0};
{1, 3, 2, 4, 0};
{1, 2, 3, 4, 5, 0};
...
		

Crossrefs

Cf. A048155.

Programs

  • Mathematica
    Table[Mod[k^3, n], {n, 13}, {k, n}] // Flatten (* Michael De Vlieger, Jun 26 2016 *)

A340806 a(n) = Sum_{k=1..n-1} (k^n mod n).

Original entry on oeis.org

0, 1, 3, 2, 10, 13, 21, 4, 27, 45, 55, 38, 78, 77, 105, 8, 136, 93, 171, 146, 210, 209, 253, 172, 250, 325, 243, 294, 406, 365, 465, 16, 528, 561, 595, 402, 666, 665, 741, 372, 820, 673, 903, 726, 945, 897, 1081, 536, 1029, 1125, 1275, 1170, 1378, 765, 1485
Offset: 1

Views

Author

Sebastian Karlsson, Jan 22 2021

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> add(k&^n mod n, k=1..n-1):
    seq(a(n), n=1..55);  # Alois P. Heinz, Feb 13 2021
  • PARI
    a(n) = sum(k=1, n-1, lift(Mod(k, n)^n)); \\ Michel Marcus, Jan 22 2021
  • Python
    def a(n):
        return sum([pow(k,n,n) for k in range(1, n)])
    for n in range(1, 56):
        print(a(n), end=', ')
    

Formula

a(n) = n*A010848(n)/2, if n is odd.
a(n) = n*(n-1)/2, if n is both odd and squarefree.
a(p^e) = (1/2)*(p-1)*p^(2*e-1), if p is an odd prime.
a(2^e) = 2^(e-1).
Showing 1-2 of 2 results.