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.

This page as a plain text file.
%I A385314 #19 Jun 27 2025 16:26:58
%S A385314 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,
%T A385314 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,
%U A385314 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
%N A385314 a(n) is the least positive integer m such that Sum_{k = 1 .. m} k^n is divisible by n.
%C A385314 If p is an odd prime, a(p) = p - 1.
%C A385314 If n > 1 is odd, a(n) <= n - 1.
%C A385314 For all n, a(n) <= n^2 - 1.
%H A385314 Robert Israel, <a href="/A385314/b385314.txt">Table of n, a(n) for n = 1..10000</a>
%e A385314 a(3) = 2 because 1^3 + 2^3 = 9 is divisible by 3, while 1^3 is not.
%p A385314 f:= proc(n) local k,t;
%p A385314   t:= 0:
%p A385314   for k from 1 do
%p A385314     t:= t + k &^ n mod n;
%p A385314     if t = 0 then return k fi;
%p A385314   od:
%p A385314 end proc:
%p A385314 map(f, [$1..100]);
%t A385314 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 *)
%o A385314 (PARI) a(n) = my(m=1); while(sum(k=1, m, k^n) % n, m++); m; \\ _Michel Marcus_, Jun 25 2025
%Y A385314 Cf. A057291, A057292, A103438.
%K A385314 nonn
%O A385314 1,2
%A A385314 _Robert Israel_, Jun 25 2025