cp's OEIS Frontend

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.

A351619 a(n) = Sum_{p|n, p prime} (-1)^p.

This page as a plain text file.
%I A351619 #40 Jan 29 2025 07:55:48
%S A351619 0,1,-1,1,-1,0,-1,1,-1,0,-1,0,-1,0,-2,1,-1,0,-1,0,-2,0,-1,0,-1,0,-1,0,
%T A351619 -1,-1,-1,1,-2,0,-2,0,-1,0,-2,0,-1,-1,-1,0,-2,0,-1,0,-1,0,-2,0,-1,0,
%U A351619 -2,0,-2,0,-1,-1,-1,0,-2,1,-2,-1,-1,0,-2,-1,-1,0,-1,0,-2,0,-2,-1,-1,0,-1,0,-1,-1,-2,0,-2,0,-1,-1,-2,0,-2,0,-2,0,-1,0,-2,0,-1
%N A351619 a(n) = Sum_{p|n, p prime} (-1)^p.
%H A351619 Antti Karttunen, <a href="/A351619/b351619.txt">Table of n, a(n) for n = 1..20000</a>
%F A351619 G.f.: Sum_{k>=1} (-x)^prime(k)/(1 - x^prime(k)).
%F A351619 a(n) = -A001221(n) if n is odd and a(n) = 2 - A001221(n) if n is even. - _Chai Wah Wu_, Mar 02 2022
%t A351619 A351619[n_] := 2*Boole[EvenQ[n]] - PrimeNu[n]; Array[A351619, 100] (* _Paolo Xausa_, Jan 28 2025 *)
%o A351619 (PARI) a(n) = my(f=factor(n)); sum(k=1, #f~, (-1)^f[k, 1]);
%o A351619 (PARI) my(N=99, x='x+O('x^N)); concat(0, Vec(sum(k=1, N, isprime(k)*(-x)^k/(1-x^k))))
%o A351619 (Python)
%o A351619 from sympy import primefactors
%o A351619 def A351619(n): return (0 if n%2 else 2) - len(primefactors(n)) # _Chai Wah Wu_, Mar 02 2022
%Y A351619 Cf. A001221, A048272, A305614.
%K A351619 sign
%O A351619 1,15
%A A351619 _Seiichi Manyama_, Mar 02 2022