A257994 Number of prime parts in the partition having Heinz number n.
0, 0, 1, 0, 1, 1, 0, 0, 2, 1, 1, 1, 0, 0, 2, 0, 1, 2, 0, 1, 1, 1, 0, 1, 2, 0, 3, 0, 0, 2, 1, 0, 2, 1, 1, 2, 0, 0, 1, 1, 1, 1, 0, 1, 3, 0, 0, 1, 0, 2, 2, 0, 0, 3, 2, 0, 1, 0, 1, 2, 0, 1, 2, 0, 1, 2, 1, 1, 1, 1, 0, 2, 0, 0, 3, 0, 1, 1, 0, 1, 4, 1, 1, 1, 2, 0, 1, 1, 0, 3
Offset: 1
Examples
a(30) = 2 because the partition with Heinz number 30 = 2*3*5 is [1,2,3], having 2 prime parts.
References
- George E. Andrews and Kimmo Eriksson, Integer Partitions, Cambridge Univ. Press, Cambridge, 2004.
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..20000
Crossrefs
Programs
-
Maple
with(numtheory): a := proc (n) local B, ct, s: B := proc (n) local nn, j, m: nn := op(2, ifactors(n)): for j to nops(nn) do m[j] := op(j, nn) end do: [seq(seq(pi(op(1, m[i])), q = 1 .. op(2, m[i])), i = 1 .. nops(nn))] end proc: ct := 0: for s to nops(B(n)) do if isprime(B(n)[s]) = true then ct := ct+1 else end if end do: ct end proc: seq(a(n), n = 1 .. 130);
-
Mathematica
B[n_] := Module[{nn, j, m}, nn = FactorInteger[n]; For[j = 1, j <= Length[nn], j++, m[j] = nn[[j]]]; Flatten[Table[Table[PrimePi[ m[i][[1]]], {q, 1, m[i][[2]]}], {i, 1, Length[nn]}]]]; a[n_] := Module[{ct, s}, ct = 0; For[s = 1, s <= Length[B[n]], s++, If[ PrimeQ[B[n][[s]]], ct++]]; ct]; Table[a[n], {n, 1, 130}] (* Jean-François Alcover, Apr 25 2017, translated from Maple *) Table[Total[Cases[FactorInteger[n],{p_,k_}/;PrimeQ[PrimePi[p]]:>k]],{n,30}] (* Gus Wiseman, Jan 17 2020 *)
-
PARI
a(n) = my(f = factor(n)); sum(i=1, #f~, if(isprime(primepi(f[i, 1])), f[i, 2], 0)); \\ Amiram Eldar, Nov 03 2023
Formula
Additive with a(p^e) = e if primepi(p) is prime, and 0 otherwise. - Amiram Eldar, Nov 03 2023
Comments