login
This site is supported by donations to The OEIS Foundation.

 

Logo

The OEIS is looking to hire part-time people to help edit core sequences, upload scanned documents, process citations, fix broken links, etc. - Neil Sloane, njasloane@gmail.com

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

Table of n, a(n) for n=1..119.

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 *)

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

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.

License Agreements, Terms of Use, Privacy Policy .

Last modified May 27 22:57 EDT 2017. Contains 287210 sequences.