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.

A099726 Sum of remainders of the n-th prime mod k, for k = 1,2,3,...,n.

This page as a plain text file.
%I A099726 #8 Feb 09 2025 16:13:12
%S A099726 0,1,3,5,7,7,14,18,28,30,31,26,38,45,63,71,93,75,96,115,101,142,161,
%T A099726 167,152,159,203,224,219,222,216,250,263,296,341,320,319,349,433,427,
%U A099726 496,419,487,481,538,537,495,631,635,676,697,777,665,820,784,874,929,856
%N A099726 Sum of remainders of the n-th prime mod k, for k = 1,2,3,...,n.
%H A099726 Daniel Suteu, <a href="/A099726/b099726.txt">Table of n, a(n) for n = 1..10000</a>
%F A099726 a(n) = n*p - A024916(p) + Sum_{k=n+1..p} k*floor(p/k), where p = prime(n). - _Daniel Suteu_, Feb 02 2021
%e A099726 a(7)=14 because the 7th prime is 17 and its remainders modulo 1,2,3,4,5,6,7 are 0,1,2,1,2,5,3 respectively and 0+1+2+1+2+5+3=14.
%p A099726 umpf:=n->add(modp(floor(ithprime(n)),m),m=1..n); seq(umpf(k),k=1..120);
%t A099726 Table[Total[Mod[Prime[p],Range[p]]],{p,Range[60]}] (* _Harvey P. Dale_, Feb 09 2025 *)
%o A099726 (PARI) a(n) = my(p=prime(n)); sum(k=1, n, p%k); \\ _Daniel Suteu_, Feb 02 2021
%o A099726 (PARI)
%o A099726 T(n) = n*(n+1)/2;
%o A099726 S(n) = my(s=sqrtint(n)); sum(k=1, s, T(n\k) + k*(n\k)) - s*T(s); \\ A024916
%o A099726 g(a,b) = my(s=0); while(a <= b, my(t=b\a); my(u=b\t); s += t*(T(u) - T(a-1)); a = u+1); s;
%o A099726 a(n) = my(p=prime(n)); n*p - S(p) + g(n+1, p); \\ _Daniel Suteu_, Feb 02 2021
%Y A099726 Cf. A000040, A004125.
%K A099726 easy,nonn
%O A099726 1,3
%A A099726 Joseph Biberstine (jrbibers(AT)indiana.edu), Nov 07 2004
%E A099726 Definition corrected by _Daniel Suteu_, Feb 02 2021