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.

A195017 If n = Product_{k >= 1} (p_k)^(c_k) where p_k is k-th prime and c_k >= 0 then a(n) = Sum_{k >= 1} c_k*((-1)^(k-1)).

This page as a plain text file.
%I A195017 #55 Aug 21 2024 21:44:42
%S A195017 0,1,-1,2,1,0,-1,3,-2,2,1,1,-1,0,0,4,1,-1,-1,3,-2,2,1,2,2,0,-3,1,-1,1,
%T A195017 1,5,0,2,0,0,-1,0,-2,4,1,-1,-1,3,-1,2,1,3,-2,3,0,1,-1,-2,2,2,-2,0,1,2,
%U A195017 -1,2,-3,6,0,1,1,3,0,1,-1,1,1,0,1,1,0,-1,-1,5,-4,2,1,0,2,0,-2,4,-1,0,-2,3,0,2,0,4,1,-1,-1,4,-1,1,1,2,-1
%N A195017 If n = Product_{k >= 1} (p_k)^(c_k) where p_k is k-th prime and c_k >= 0 then a(n) = Sum_{k >= 1} c_k*((-1)^(k-1)).
%C A195017 Let p(n,x) be the completely additive polynomial-valued function such that p(1,x) = 0 and p(prime(n),x) = x^(n-1), like is defined in A206284 (although here we are not limited to just irreducible polynomials). Then a(n) is the value of the polynomial encoded in such a manner by n, when it is evaluated at x=-1. - The original definition rewritten and clarified by _Antti Karttunen_, Oct 03 2018
%C A195017 Positions of 0 give the values of n for which the polynomial p(n,x) is divisible by x+1. For related sequences, see the Mathematica section.
%C A195017 Also the number of odd prime indices of n minus the number of even prime indices of n (both counted with multiplicity), where a prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798. - _Gus Wiseman_, Oct 24 2023
%H A195017 Antti Karttunen, <a href="/A195017/b195017.txt">Table of n, a(n) for n = 1..65537</a>
%F A195017 Totally additive with a(p^e) = e * (-1)^(1+PrimePi(p)), where PrimePi(n) = A000720(n). - _Antti Karttunen_, Oct 03 2018
%F A195017 Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Sum_{p prime} = (-1)^(primepi(p)+1)/(p-1) = Sum_{k>=1} (-1)^(k+1)/A006093(k) = A078437 +  Sum_{k>=1} (-1)^(k+1)/A036689(k) = 0.6339266524059... . - _Amiram Eldar_, Sep 29 2023
%F A195017 a(n) = A257991(n) - A257992(n). - _Gus Wiseman_, Oct 24 2023
%F A195017 a(n) = -Sum_{k=1..pi(n)} (-1)^k * valuation(n, prime(k)). - _Friedjof Tellkamp_, Aug 05 2024
%e A195017 The sequence can be read from a list of the polynomials:
%e A195017   p(n,x)      with x = -1, gives a(n)
%e A195017 ------------------------------------------
%e A195017   p(1,x) = 0           0
%e A195017   p(2,x) = 1x^0        1
%e A195017   p(3,x) = x          -1
%e A195017   p(4,x) = 2x^0        2
%e A195017   p(5,x) = x^2         1
%e A195017   p(6,x) = 1+x         0
%e A195017   p(7,x) = x^3        -1
%e A195017   p(8,x) = 3x^0        3
%e A195017   p(9,x) = 2x         -2
%e A195017   p(10,x) = x^2 + 1    2.
%e A195017 (The list runs through all the polynomials whose coefficients are nonnegative integers.)
%t A195017 b[n_] := Table[x^k, {k, 0, n}];
%t A195017 f[n_] := f[n] = FactorInteger[n]; z = 200;
%t A195017 t[n_, m_, k_] := If[PrimeQ[f[n][[m, 1]]] && f[n][[m, 1]]
%t A195017 == Prime[k], f[n][[m, 2]], 0];
%t A195017 u = Table[Apply[Plus,
%t A195017     Table[Table[t[n, m, k], {k, 1, PrimePi[n]}], {m, 1,
%t A195017       Length[f[n]]}]], {n, 1, z}];
%t A195017 p[n_, x_] := u[[n]].b[-1 + Length[u[[n]]]]
%t A195017 Table[p[n, x] /. x -> 0, {n, 1, z/2}]   (* A007814 *)
%t A195017 Table[p[2 n, x] /. x -> 0, {n, 1, z/2}] (* A001511 *)
%t A195017 Table[p[n, x] /. x -> 1, {n, 1, z}]     (* A001222 *)
%t A195017 Table[p[n, x] /. x -> 2, {n, 1, z}]     (* A048675 *)
%t A195017 Table[p[n, x] /. x -> 3, {n, 1, z}]     (* A090880 *)
%t A195017 Table[p[n, x] /. x -> -1, {n, 1, z}]    (* A195017 *)
%t A195017 z = 100; Sum[-(-1)^k IntegerExponent[Range[z], Prime[k]], {k, 1, PrimePi[z]}] (* _Friedjof Tellkamp_, Aug 05 2024 *)
%o A195017 (PARI) A195017(n) = { my(f); if(1==n, 0, f=factor(n); sum(i=1, #f~, f[i,2] * (-1)^(1+primepi(f[i,1])))); } \\ _Antti Karttunen_, Oct 03 2018
%Y A195017 Cf. A206284, A277322, A284010.
%Y A195017 For other evaluation functions of such encoded polynomials, see A001222, A048675, A056239, A090880, A248663.
%Y A195017 Cf. A006093, A036689, A078437.
%Y A195017 Zeros are A325698, distinct A325700.
%Y A195017 For sum instead of count we have A366749 = A366531 - A366528.
%Y A195017 A000009 counts partitions into odd parts, ranked by A066208.
%Y A195017 A035363 counts partitions into even parts, ranked by A066207.
%Y A195017 A112798 lists prime indices, reverse A296150, sum A056239.
%Y A195017 A257991 counts odd prime indices, even A257992.
%Y A195017 A300061 lists numbers with even sum of prime indices, odd A300063.
%Y A195017 Cf. A019507, A106529, A239241, A239261, A369180.
%K A195017 sign,easy
%O A195017 1,4
%A A195017 _Clark Kimberling_, Feb 06 2012
%E A195017 More terms, name changed and example-section edited by _Antti Karttunen_, Oct 03 2018