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 A161517 #17 Apr 09 2023 09:53:06 %S A161517 1,3,8,12,13,17,31,36,36,47,61,70,77,85,103,112,125,124,138,167,184, %T A161517 197,218,198,248,269,258,284,328,339,358,374,414,420,449,454,492,529, %U A161517 520,553,578,586,672,693,693,738,725,799,840,835,852,956,981,992,1049,1036 %N A161517 Sum of remainders of c mod k where k = 1, 2, 3, ..., c and c is the n-th composite number. %H A161517 Harvey P. Dale, <a href="/A161517/b161517.txt">Table of n, a(n) for n = 1..1000</a> %F A161517 a(n) = (c mod (c-1)) + (c mod (c-2)) + ... + (c mod 3) + (c mod 2). %e A161517 a(1) = 1 (= (4 mod 3) + 0); %e A161517 a(2) = 3 (= (6 mod 5) + (6 mod 4) + 0 + 0); %e A161517 a(3) = 8 (= (8 mod 7) + (8 mod 6) + (8 mod 5) + 0 + (8 mod 3) + 0), etc. %p A161517 A002808 := proc(n) local a; if n = 1 then 4; else for a from procname(n-1)+1 do if not isprime(a) then RETURN(a) ; end if; end do; end if; end proc: A004125 := proc(n) add( n mod k, k=1..n) ; end: A161517 := proc(n) local c; A004125( A002808(n)) ; end: seq(A161517(n),n=1..80) ; # _R. J. Mathar_, Aug 03 2009 %t A161517 With[{cmps=Select[Range[200],CompositeQ]},Table[Total[Mod[n,Range[n-1]]],{n,cmps}]] (* _Harvey P. Dale_, Apr 09 2023 *) %o A161517 (PARI) a(n)=my(c=n+n\log(n+1));for(i=0,n-c+primepi(c),if(isprime(c++),i--));sum(k=2,c,c%k) \\ _Charles R Greathouse IV_, Oct 12 2009 %Y A161517 Cf. A002808, A004125. %K A161517 nonn,easy %O A161517 1,2 %A A161517 _Juri-Stepan Gerasimov_, Jun 12 2009 %E A161517 Corrected and extended by _R. J. Mathar_, Aug 03 2009