This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A024934 Sum of remainders n mod p, over all primes p < n. 15
 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, 37, 37, 46, 46, 56, 65, 62, 54, 53, 59, 70, 61, 57, 62, 74, 75, 88, 89, 95, 84, 98, 108, 116, 124, 119, 119, 134, 145, 145, 152, 146, 131, 147, 154, 171, 156, 164, 180, 180, 182, 200, 200, 193, 198, 217 (list; graph; refs; listen; history; text; internal format)
 OFFSET 0,6 LINKS Alois P. Heinz, Table of n, a(n) for n = 0..10000 FORMULA a(n) = n*A000720(n) - A024924(n). - Max Alekseyev, Feb 10 2012 a(n) = a(n-1) + A000720(n-1) - A105221(n). - Max Alekseyev, Nov 28 2017 EXAMPLE a(5) = 3. The remainder when 5 is divided by primes 2, 3 respectively is 1, 2, and their sum = 3. 10 = 2*5+0 = 3*3+1 = 5*2+0 = 7*1+3: a(10) = 0+1+0+3 = 4. MAPLE A024934 := proc(n)     local a, i, p ;     a := 0 ;     for i from 1 do         p := ithprime(i) ;         if p > n then             break;         end if;         a := a+ modp(n, p) ;     end do:     a ; end proc: seq(A024934(n), n=0..100) ; # Paolo P. Lava, Apr 16 2012 MATHEMATICA a[n_] := Sum[Mod[n, Prime[i]], {i, PrimePi@ n}]; Array[a, 72, 0] (* Giovanni Resta, Jun 24 2016 *) PROG (PARI) a(n)=my(r=0); forprime(p=2, n, r+=n%p); r; \\ Joerg Arndt, Nov 05 2016 CROSSREFS Cf. A004125, A067435, A067436, A013939, A101336. Sequence in context: A100954 A071315 A072267 * A186358 A170839 A049918 Adjacent sequences:  A024931 A024932 A024933 * A024935 A024936 A024937 KEYWORD nonn AUTHOR EXTENSIONS Edited by Max Alekseyev, Jan 30 2012 a(0)=0 prepended by Max Alekseyev, Dec 10 2013 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified October 22 17:55 EDT 2019. Contains 328319 sequences. (Running on oeis4.)