This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A120630 #14 Jan 22 2024 01:24:03 %S A120630 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, %T A120630 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, %U A120630 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 %N A120630 Dirichlet inverse of A002654. %H A120630 Andrew Howroyd, <a href="/A120630/b120630.txt">Table of n, a(n) for n = 1..1000</a> %F A120630 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. %F A120630 Sum_{k=1..n} abs(a(k)) ~ c * n, where c = 3/(2*Pi*G) = 0.521269..., and G is Catalan's constant (A006752). - _Amiram Eldar_, Jan 22 2024 %e A120630 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. %p A120630 A120630 := proc(n) %p A120630 local a,pp; %p A120630 if n = 1 then %p A120630 1; %p A120630 else %p A120630 a := 1 ; %p A120630 for pp in ifactors(n)[2] do %p A120630 if op(2,pp) > 2 then %p A120630 a := 0; %p A120630 elif op(1,pp) = 2 then %p A120630 if op(2,pp) = 1 then %p A120630 a := -a ; %p A120630 else %p A120630 a := 0 ; %p A120630 end if; %p A120630 elif modp(op(1,pp),4) = 3 then %p A120630 if op(2,pp) = 1 then %p A120630 a := 0 ; %p A120630 else %p A120630 a := -a ; %p A120630 end if; %p A120630 else %p A120630 if op(2,pp) = 1 then %p A120630 a := -2*a ; %p A120630 else %p A120630 ; %p A120630 end if; %p A120630 end if; %p A120630 end do: %p A120630 a; %p A120630 end if; %p A120630 end proc: # _R. J. Mathar_, Sep 15 2015 %t A120630 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_ *) %o A120630 (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 %Y A120630 Cf. A002654, A006752, A023900, A046692, A053822, A053825, A053826, A101035. %K A120630 mult,easy,sign %O A120630 1,5 %A A120630 _Gerard P. Michon_, Jun 25 2006