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.

A094263 Triangle read by rows: for 1 <= k <= n, a(n, k) = n^k mod k.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 2, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 2, 1, 0, 0, 0, 2, 0, 3, 4, 1, 0, 0, 1, 0, 1, 4, 3, 2, 1, 0, 0, 0, 1, 0, 0, 4, 3, 0, 1, 0, 0, 1, 2, 1, 1, 1, 4, 1, 8, 1, 0, 0, 0, 0, 0, 2, 0, 5, 0, 0, 4, 1, 0, 0, 1, 1, 1, 3, 1, 6, 1, 1, 9, 2, 1, 0, 0, 0, 2, 0, 4, 4, 0, 0, 8, 6, 3, 4, 1, 0
Offset: 1

Views

Author

Amarnath Murthy, Apr 26 2004

Keywords

Crossrefs

Programs

  • Mathematica
    Table[PowerMod[n,k,k],{n,20},{k,n}]//Flatten (* Harvey P. Dale, Apr 14 2020 *)

Extensions

Edited and extended by David Wasserman, Jan 24 2007

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.