OFFSET
1,5
COMMENTS
For n >= 2, a(n) is the largest part minus the number of distinct parts of the partition having Heinz number n. The Heinz number of a partition [i_1, i_2, ..., i_r] is defined as Product_{j=1..r} (i_j-th prime) (concept used by Alois P. Heinz in A215366 as an encoding of a partition). For example, for the partition [1, 1, 1, 4] we get 2*2*2*7 = 56; a(56) = 4 - #{1,4} = 2. - Emeric Deutsch, Jun 09 2015 [edited by Peter Munn, Apr 09 2024]
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..20000 (first 1000 terms from G. C. Greubel)
FORMULA
MAPLE
with(numtheory): a := proc (n) local B: 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: max(B(n))-nops(convert(B(n), set)) end proc: 0, seq(a(n), n = 2 .. 96); # The subprogram B yields the partition having Heinz number n. # Emeric Deutsch, Jun 09 2015
# second Maple program:
with(numtheory):
a:= n-> (s-> pi(max(0, s))-nops(s))(factorset(n)):
seq(a(n), n=1..100); # Alois P. Heinz, Sep 03 2019
MATHEMATICA
a[1] = 0; a[n_] := With[{fi = FactorInteger[n]}, PrimePi[fi][[-1, 1]] - Length[fi]]; Array[a, 100] (* Jean-François Alcover, Jan 08 2016 *)
PROG
(PARI) a(n) = if (n==1, 0, my(pf=factor(n)[, 1]); primepi(vecmax(pf)) - #pf); \\ Michel Marcus, May 05 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Reinhard Zumkeller, Dec 20 2002
STATUS
approved