A371733 Maximal length of a factorization of n into factors > 1 all having the same sum of prime indices.
0, 1, 1, 2, 1, 1, 1, 3, 2, 1, 1, 2, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 3, 1, 1, 2, 1, 5, 1, 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 6, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 4
Offset: 1
Keywords
Examples
The factorizations of 588 of this type are (7*7*12), (21*28), (588), so a(588) = 3. The factorizations of 900 of this type are (5*5*6*6), (9*10*10), (25*36), (30*30), (900), so a(900) = 4.
Links
Crossrefs
Programs
-
Mathematica
facs[n_]:=If[n<=1,{{}},Join@@Table[Map[Prepend[#,d]&, Select[facs[n/d],Min@@#>=d&]],{d,Rest[Divisors[n]]}]]; hwt[n_]:=Total[Cases[FactorInteger[n],{p_,k_}:>PrimePi[p]*k]]; Table[Max[Length/@Select[facs[n],SameQ@@hwt/@#&]],{n,100}]
-
PARI
A056239(n) = if(1==n, 0, my(f=factor(n)); sum(i=1, #f~, f[i, 2] * primepi(f[i, 1]))); all_have_same_sum_of_pis(facs) = if(!#facs, 1, (#Set(apply(A056239,facs)) == 1)); A371733(n, m=n, facs=List([])) = if(1==n, if(all_have_same_sum_of_pis(facs),#facs,0), my(s=0, newfacs); fordiv(n, d, if((d>1)&&(d<=m), newfacs = List(facs); listput(newfacs,d); s = max(s, A371733(n/d, d, newfacs)))); (s)); \\ Antti Karttunen, Jan 20 2025
Extensions
Data section extended to a(108) by Antti Karttunen, Jan 20 2025
Comments