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

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A353458 Dirichlet inverse of A353457. 7

%I #24 Oct 23 2023 02:01:51

%S 1,1,-1,1,1,-1,-1,1,0,1,1,-1,-1,-1,-1,1,1,0,-1,1,1,1,1,-1,1,-1,0,-1,

%T -1,-1,1,1,-1,1,-1,0,-1,-1,1,1,1,1,-1,1,0,1,1,-1,0,1,-1,-1,-1,0,1,-1,

%U 1,-1,1,-1,-1,1,0,1,-1,-1,1,1,-1,-1,-1,0,1,-1,-1,-1,-1,1,-1,1,0,1,1,1,1,-1,1,1,-1,0,1,1,-1,1

%N Dirichlet inverse of A353457.

%H Antti Karttunen, <a href="/A353458/b353458.txt">Table of n, a(n) for n = 1..65537</a>

%H <a href="/index/Pri#prime_indices">Index entries for sequences computed from indices in prime factorization</a>.

%F a(1) = 1, for n > 1, a(n) = -Sum_{d|n, d<n} A353457(n/d) * a(d).

%F a(n) = A353457(A064989(n)).

%F For all n >= 1, a(A000040(n)) = ((-1)^(n-1)).

%F The sequence is multiplicative. Let p be a prime. If the number of primes <= p [A000720(p)] is odd, then a(p^e) = 1. If the number of primes <= p is even, then a(p) = -1 and a(p^e) = 0 if e > 1. - _Sebastian Karlsson_, Apr 21 2022

%t f[p_, e_] := If[OddQ[PrimePi[p]], 1, If[e == 1, -1, 0]]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* _Amiram Eldar_, Oct 23 2023 *)

%o (PARI)

%o A000265(n) = (n>>valuation(n,2));

%o A064989(n) = { my(f=factor(A000265(n))); for(i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f); };

%o memoA353457 = Map();

%o A353457(n) = if(1==n,1,my(v); if(mapisdefined(memoA353457,n,&v), v, v = -sumdiv(n,d,if(d<n,A353457(A064989(n/d))*A353457(d),0)); mapput(memoA353457,n,v); (v)));

%o A353458(n) = A353457(A064989(n));

%o (PARI) A353458(n) = { my(f=factor(n)); prod(i=1,#f~,if(primepi(f[i,1])%2, 1, if(f[i,2]==1, -1, 0))); }; \\ (After _Sebastian Karlsson_'s multiplicative formula)

%o (Python)

%o from math import prod

%o from sympy import primepi, factorint

%o def A353458(n): return prod(-int(e==1) for p, e in factorint(n).items() if not primepi(p)&1) # _Chai Wah Wu_, Jan 05 2023

%Y Cf. A000040, A000720, A064989, A353457 [Dirichlet inverse], A353459 [sum with it].

%Y Cf. also A353468.

%K sign,mult

%O 1

%A _Antti Karttunen_, Apr 21 2022

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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 21 09:38 EDT 2024. Contains 374472 sequences. (Running on oeis4.)