OFFSET
0,8
COMMENTS
The amplitude and periodicity of fluctuations increase... for example a(813) through a(836) are all positive and a(914) through a(937) all are positive except for a(922).
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..10000
EXAMPLE
a(10) = -4 because 10 (mod 2) - 10 (mod 3) + 10 (mod 5) - 10 (mod 7) = 0-1+0-3.
MAPLE
a:= n-> add(-irem(n, ithprime(i))*(-1)^i, i=1..numtheory[pi](n)):
seq(a(n), n=0..100); # Alois P. Heinz, Jul 27 2015
MATHEMATICA
Table[Total[Times@@@Partition[Riffle[Mod[n, Prime[Range[PrimePi[n]]]], {1, -1}, {2, -1, 2}], 2]], {n, 0, 90}] (* Harvey P. Dale, Jun 03 2017 *)
CROSSREFS
KEYWORD
AUTHOR
Gordon Hamilton, Dec 24 2004
EXTENSIONS
a(0)=0 prepended by Alois P. Heinz, Jul 27 2015
STATUS
approved