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.

User: Lavender Malison

Lavender Malison's wiki page.

Lavender Malison has authored 1 sequences.

A375746 The alternating sum of sequentially decreasing moduli for every positive integer.

Original entry on oeis.org

0, 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, 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, -27, -34
Offset: 1

Author

Lavender Malison, Aug 26 2024

Keywords

Comments

It is expected that this sequence will contain all integers, however in the first 25000 terms, there are only 14907 distinct integers, with -39 and 54 being the two 2 digit numbers not appearing in the first 25000 terms. This sequence, while generated in a different manner, appears to be A154585 shifted over one term and without the absolute value taken.

Examples

			For n=6, a(6) = (6 mod 6)-(6 mod 5)+(6 mod 4)-(6 mod 3)+(6 mod 2)-(6 mod 1) = 0-1+2-0+0-0 = 1.
		

Crossrefs

Cf. A154585.

Programs

  • Mathematica
    Table[Sum[(-1)^(n-k)*Mod[n,k],{k,n}],{n,60}] (* James C. McMahon, Oct 18 2024 *)

Formula

a(n) = Sum_{k=1..n} (-1)^(n-k) * (n mod k).
abs(a(n)) = A154585(n-1) for n>=2.