This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A120630 Dirichlet inverse of A002654. 2
 1, -1, 0, 0, -2, 0, 0, 0, -1, 2, 0, 0, -2, 0, 0, 0, -2, 1, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, -2, 0, 0, 0, 0, 2, 0, 0, -2, 0, 0, 0, -2, 0, 0, 0, 2, 0, 0, 0, -1, -1, 0, 0, -2, 0, 0, 0, 0, 2, 0, 0, -2, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, -2, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 4, 0, 0, 0, -2, -2, 0, 0, 0, 0, 0, 0, -2, 1, 0, 0, -2, 0, 0, 0, 0, 2, 0, 0, -2, 0, 0, 0, -2, 0, 0, 0, 2, 0, 0 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,5 LINKS Andrew Howroyd, Table of n, a(n) for n = 1..1000 FORMULA Multiplicative function with a(p^e)=0 if e>2. a(2)=-1, a(4)=0. If p is a prime congruent to 3 modulo 4, then a(p)=0 and a(p^2)=-1. If p is a prime congruent to 1 modulo 4, then a(p)=-2 and a(p^2)=1. EXAMPLE a(65)=4 because 65 is 5 times 13 and both of those primes are congruent to 1 modulo 4. Doubling an odd index yields the opposite of the value (e.g., a(130)=-4) because a(2)=-1. Doubling an even index yields zero. MAPLE A120630 := proc(n)     local a, pp;     if n = 1 then         1;     else         a := 1 ;         for pp in ifactors(n)[2] do             if op(2, pp) > 2 then                 a := 0;             elif op(1, pp) = 2 then                 if op(2, pp) = 1 then                     a := -a ;                 else                     a := 0 ;                 end if;             elif modp(op(1, pp), 4) = 3 then                 if op(2, pp) = 1 then                     a := 0 ;                 else                     a := -a ;                 end if;             else                 if op(2, pp) = 1 then                     a := -2*a ;                 else                     ;                 end if;             end if;         end do:         a;     end if; end proc: # R. J. Mathar, Sep 15 2015 MATHEMATICA A120630[n_] := Module[{a, pp}, If[n == 1, 1, a = 1; Do[Which[pp[[2]] > 2, a = 0, pp[[1]] == 2, If[pp[[2]] == 1, a = -a, a = 0], Mod[pp[[1]], 4] == 3, If[pp[[2]] == 1, a = 0, a = -a], True, If[pp[[2]] == 1, a = -2*a]], {pp, FactorInteger[n]}]; a]]; Array[A120630, 120] (* Jean-François Alcover, Apr 24 2017, after R. J. Mathar *) PROG (PARI) seq(n)={dirdiv(vector(n, n, n==1), vector(n, n, sumdiv( n, d, (d%4==1) - (d%4==3))))} \\ Andrew Howroyd, Aug 05 2018 CROSSREFS Cf. A002654, A023900, A046692, A053822, A053825, A053826, A101035. Sequence in context: A079126 A186336 A025891 * A248509 A281542 A191410 Adjacent sequences:  A120627 A120628 A120629 * A120631 A120632 A120633 KEYWORD mult,easy,sign,changed AUTHOR Gerard P. Michon, Jun 25 2006 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 | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified August 17 05:38 EDT 2018. Contains 313810 sequences. (Running on oeis4.)