The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A101336 Alternating addition and subtraction of the residues of the primes less than the number. 2
 0, 0, 0, 1, -1, -1, 1, 2, 0, 3, -4, -4, -2, -1, 4, 2, 0, 0, 2, 3, -4, 6, -7, -7, -5, -9, 3, 7, 13, 14, 10, 10, 9, 2, -16, -13, -11, -10, 7, 23, 16, 16, 25, 26, 13, 11, -14, -14, -12, -4, -10, -23, -11, -10, -9, -25, -20, 2, 29, 29, 26, 27, -6, 4, 2, 10, 0, 0, -18, -37, -36, -35, -34, -34, 2, 1, 19, 16, 31, 32, 25, 28, -15, -15, -6, -27, 15 (list; graph; refs; listen; history; text; internal format)
 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 Cf. A024934. Sequence in context: A274441 A213859 A330492 * A300001 A137218 A306765 Adjacent sequences:  A101333 A101334 A101335 * A101337 A101338 A101339 KEYWORD easy,sign,look AUTHOR Gordon Hamilton, Dec 24 2004 EXTENSIONS a(0)=0 prepended by Alois P. Heinz, Jul 27 2015 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified February 27 13:18 EST 2020. Contains 332306 sequences. (Running on oeis4.)