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.
%I A050482 #28 Feb 26 2024 10:32:38 %S A050482 0,1,4,8,22,28,51,64,98,151,167,233,297,325,403,505,635,645,790,904, %T A050482 923,1113,1244,1422,1654,1800,1888,2056,2098,2256,2849,3066,3326,3450, %U A050482 3969,4045,4329,4696,5014,5325,5767,5759,6499,6565,6898 %N A050482 Sum of remainders when n-th prime is divided by all preceding integers. %C A050482 a(n)/(n*log(n))^2 appears to approach a constant ~0.22... for large n. - _Benedict W. J. Irwin_, Dec 07 2016 %C A050482 Irwin's comment is incorrect. - _Bill McEachen_, Feb 04 2024. [Indeed, according to the first formula in A004125, a(n)/(n*log(n))^2 approaches a constant, which is not 0.22 but 1-Pi^2/12 = 0.1775... - _Amiram Eldar_, Feb 04 2024] %H A050482 Charles R Greathouse IV, <a href="/A050482/b050482.txt">Table of n, a(n) for n = 1..10000</a> %F A050482 a(n) = A004125(A000040(n)). - _R. J. Mathar_, Jun 12 2009 %e A050482 a(4) = 8 because remainders when 7 is divided by 1..6 are 0,1,1,3,2,1, which add to 8. %e A050482 a(2) = 3 mod (3-1) = 1. %e A050482 a(3) = (5 mod (5-1)) + (5 mod (5-2)) + (5 mod (5-3)) = 2 + 1 + 1 = 4. %p A050482 A050482 := proc(n) local a,i; a := 0; for i from 1 to ithprime(n)-1 do a := a+(ithprime(n) mod i); od: end; %t A050482 Table[Sum[Mod[Prime[n],k],{k,Prime[n]-1}],{n,45}] (* _James C. McMahon_, Feb 08 2024 *) %o A050482 (PARI) a(n)=my(p=prime(n));sum(k=2, p, p%k) \\ _Charles R Greathouse IV_, Jun 03 2013 %o A050482 (Python) %o A050482 from math import isqrt %o A050482 from sympy import prime %o A050482 def A050482(n): return (p:=prime(n))**2+((s:=isqrt(p))**2*(s+1)-sum((q:=p//k)*((k<<1)+q+1) for k in range(1,s+1))>>1) # _Chai Wah Wu_, Nov 01 2023 %Y A050482 Cf. A004125, A034953. %K A050482 nonn %O A050482 1,3 %A A050482 Brian Wallace (wallacebrianedward(AT)yahoo.co.uk), Dec 26 1999