The OEIS is supported by the many generous donors to the OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A071321 Alternating sum of all prime factors of n; primes nondecreasing, starting with the least prime factor: A020639(n). 38
 0, 2, 3, 0, 5, -1, 7, 2, 0, -3, 11, 3, 13, -5, -2, 0, 17, 2, 19, 5, -4, -9, 23, -1, 0, -11, 3, 7, 29, 4, 31, 2, -8, -15, -2, 0, 37, -17, -10, -3, 41, 6, 43, 11, 5, -21, 47, 3, 0, 2, -14, 13, 53, -1, -6, -5, -16, -27, 59, -2, 61, -29, 7, 0, -8 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 COMMENTS a(n) = 0 iff n square, a(A000290(n)) = 0; a(n) <= 0 iff A001222(n) is even; a(n) = n iff n prime, a(A000040(n)) = A000040(n). a(2n) = -a(n) + 2. - Ralf Stephan LINKS Reinhard Zumkeller, Table of n, a(n) for n = 1..10000 FORMULA a(n) = -A071322(n)*A008836(n). - Franklin T. Adams-Watters, Oct 18 2006 EXAMPLE 72 = 2*2*2*3*3, therefore a(72) = 2 - 2 + 2 - 3 + 3 = 2; 90 = 2*3*3*5, therefore a(90) = 2 - 3 + 3 - 5 = -3. MATHEMATICA Join[{0}, Table[Total[Times@@@Partition[Riffle[Flatten[Table[#[[1]], {#[[2]]}]&/@ FactorInteger[n]], {1, -1}, {2, -1, 2}], 2]], {n, 2, 100}]] (* Harvey P. Dale, Sep 23 2015 *) PROG (Haskell) a071321 1 = 0 a071321 n = sum \$ zipWith (*) a033999_list \$ a027746_row n -- Reinhard Zumkeller, Jun 01 2013 (Python) from sympy import factorint def A071321(n):     fs = factorint(n, multiple=True)     return sum(fs[::2])-sum(fs[1::2]) # Chai Wah Wu, Aug 23 2021 CROSSREFS Cf. A001414, A020639, A071322, A071323. Cf. A008836. Cf. A027746, A033999. Sequence in context: A140664 A335940 A339767 * A071322 A072594 A353051 Adjacent sequences:  A071318 A071319 A071320 * A071322 A071323 A071324 KEYWORD sign AUTHOR Reinhard Zumkeller, May 18 2002 STATUS approved

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

Last modified May 20 01:04 EDT 2022. Contains 353847 sequences. (Running on oeis4.)