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.

A385314 a(n) is the least positive integer m such that Sum_{k = 1 .. m} k^n is divisible by n.

Original entry on oeis.org

1, 3, 2, 7, 4, 4, 6, 15, 2, 4, 10, 8, 12, 3, 5, 31, 16, 27, 18, 24, 6, 11, 22, 31, 4, 12, 2, 7, 28, 4, 30, 63, 11, 8, 14, 40, 36, 19, 12, 31, 40, 8, 42, 16, 5, 11, 46, 31, 6, 4, 17, 32, 52, 40, 10, 31, 18, 28, 58, 31, 60, 15, 6, 127, 4, 27, 66, 8, 23, 7, 70, 80, 72, 36, 5, 47, 6, 36, 78, 31, 2
Offset: 1

Views

Author

Robert Israel, Jun 25 2025

Keywords

Comments

If p is an odd prime, a(p) = p - 1.
If n > 1 is odd, a(n) <= n - 1.
For all n, a(n) <= n^2 - 1.

Examples

			a(3) = 2 because 1^3 + 2^3 = 9 is divisible by 3, while 1^3 is not.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local k,t;
      t:= 0:
      for k from 1 do
        t:= t + k &^ n mod n;
        if t = 0 then return k fi;
      od:
    end proc:
    map(f, [$1..100]);
  • Mathematica
    a[n_]:=Module[{m=1},While[!Divisible[Sum[k^n,{k,1,m}],n],m++];m];Array[a,81] (* James C. McMahon, Jun 25 2025 *)
  • PARI
    a(n) = my(m=1); while(sum(k=1, m, k^n) % n, m++); m; \\ Michel Marcus, Jun 25 2025