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.

A325036 Difference between product and sum of prime indices of n.

Original entry on oeis.org

1, 0, 0, -1, 0, -1, 0, -2, 0, -1, 0, -2, 0, -1, 1, -3, 0, -1, 0, -2, 2, -1, 0, -3, 3, -1, 2, -2, 0, 0, 0, -4, 3, -1, 5, -2, 0, -1, 4, -3, 0, 1, 0, -2, 5, -1, 0, -4, 8, 2, 5, -2, 0, 1, 7, -3, 6, -1, 0, -1, 0, -1, 8, -5, 9, 2, 0, -2, 7, 4, 0, -3, 0, -1, 10, -2, 11, 3, 0, -4, 8, -1, 0, 0, 11, -1, 8, -3, 0, 4, 14, -2, 9
Offset: 1

Views

Author

Gus Wiseman, Mar 25 2019

Keywords

Comments

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.

Examples

			The prime indices of 45 are {2,2,3}, with product 12 and sum 7, so a(45) = 5.
		

Crossrefs

Positions of zeros are A301987. Positions of ones are A325041. Positions of negative ones are A325042.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Table[Times@@primeMS[n]-Total[primeMS[n]],{n,100}]
    dps[n_]:=Module[{pi=Flatten[Table[PrimePi[#[[1]]],#[[2]]]&/@FactorInteger[n]]},Times@@pi-Total[pi]]; Join[{1},Array[dps,100,2]] (* Harvey P. Dale, May 26 2023 *)
  • PARI
    A003963(n) = { n=factor(n); n[, 1]=apply(primepi, n[, 1]); factorback(n) }; \\ From A003963
    A056239(n) = { my(f); if(1==n, 0, f=factor(n); sum(i=1, #f~, f[i, 2] * primepi(f[i, 1]))); };
    A325036(n) = (A003963(n) - A056239(n)); \\ Antti Karttunen, May 08 2022

Formula

a(n) = A003963(n) - A056239(n).
For all n >= 1, a(A325040(n)) = a(A122111(A325040(n))). - Antti Karttunen, May 08 2022

Extensions

Data section extended up to a(93) by Antti Karttunen, May 08 2022