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.

A024934 Sum of remainders n mod p, over all primes p < n.

This page as a plain text file.
%I A024934 #43 Jul 02 2025 13:44:44
%S A024934 0,0,0,1,1,3,1,4,6,7,4,8,8,13,10,8,12,18,20,27,28,26,21,29,33,37,31,
%T A024934 37,37,46,46,56,65,62,54,53,59,70,61,57,62,74,75,88,89,95,84,98,108,
%U A024934 116,124,119,119,134,145,145,152,146,131,147,154,171,156,164,180,180,182,200,200,193,198,217
%N A024934 Sum of remainders n mod p, over all primes p < n.
%H A024934 Alois P. Heinz, <a href="/A024934/b024934.txt">Table of n, a(n) for n = 0..10000</a>
%F A024934 a(n) = n*A000720(n) - A024924(n). - _Max Alekseyev_, Feb 10 2012
%F A024934 a(n) = a(n-1) + A000720(n-1) - A105221(n). - _Max Alekseyev_, Nov 28 2017
%e A024934 a(5) = 3. The remainder when 5 is divided by primes 2, 3 respectively is 1, 2, and their sum = 3.
%e A024934 10 = 2*5+0 = 3*3+1 = 5*2+0 = 7*1+3: a(10) = 0+1+0+3 = 4.
%t A024934 a[n_] := Sum[Mod[n, Prime[i]], {i, PrimePi@ n}]; Array[a, 72, 0] (* _Giovanni Resta_, Jun 24 2016 *)
%t A024934 Table[Total[Mod[n,Prime[Range[PrimePi[n]]]]],{n,0,80}] (* _Harvey P. Dale_, Jul 02 2025 *)
%o A024934 (PARI) a(n)=my(r=0);forprime(p=2,n,r+=n%p); r; \\ _Joerg Arndt_, Nov 05 2016
%Y A024934 Cf. A004125, A067435, A067436, A013939, A101336.
%K A024934 nonn
%O A024934 0,6
%A A024934 _Clark Kimberling_
%E A024934 Edited by _Max Alekseyev_, Jan 30 2012
%E A024934 a(0)=0 prepended by _Max Alekseyev_, Dec 10 2013