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 A154585 #15 Sep 18 2021 09:05:19 %S A154585 0,1,1,0,1,2,4,0,3,4,5,4,1,10,4,3,1,2,9,2,11,12,17,11,0,13,0,1,6,7,23, %T A154585 8,7,20,10,9,8,25,14,13,4,3,20,13,34,35,34,26,8,13,6,5,8,25,24,1,26, %U A154585 27,34,33,4,37,25,6,11,12,11,16,37,38,60,59,24,25,0,19,40,41,54,14,25,26,51 %N A154585 a(n) = abs(Sum_{k=1..n} (-1)^k * (n-k+1 mod k)). %H A154585 Amiram Eldar, <a href="/A154585/b154585.txt">Table of n, a(n) for n = 1..10000</a> %e A154585 a(5) = -(5 mod 1)+(4 mod 2)-(3 mod 3)+(2 mod 4)-(1 mod 5) = -0+0-0+2-1 = 1. %p A154585 P:=proc(i) local a,n; for n from 1 by 1 to i do a:=abs(sum('(-1)^k*((n-k+1) mod k)','k'=1..n)); print(a); od; end: P(100); %t A154585 a[n_] := Abs @ Sum[(-1)^k * Mod[n - k + 1, k], {k, 1, n}]; Array[a, 100] (* _Amiram Eldar_, Sep 18 2021 *) %o A154585 (PARI) a(n) = abs(sum(k=1, n, (-1)^k * lift(Mod(n-k+1, k)))); \\ _Michel Marcus_, Sep 18 2021 %Y A154585 Cf. A004125, A051127, A154586. %K A154585 easy,nonn %O A154585 1,6 %A A154585 _Paolo P. Lava_ and _Giorgio Balzarotti_, Jan 12 2009