A366737 Number of numbers k <= A056239(n) that can be written as a linear combination of the prime indices of n (allowing coefficients of 0).
0, 1, 1, 2, 1, 3, 1, 3, 2, 4, 1, 4, 1, 5, 4, 4, 1, 5, 1, 5, 3, 6, 1, 5, 2, 7, 3, 6, 1, 6, 1, 5, 5, 8, 4, 6, 1, 9, 4, 6, 1, 7, 1, 7, 6, 10, 1, 6, 2, 7, 6, 8, 1, 7, 4, 7, 5, 11, 1, 7, 1, 12, 4, 6, 3, 8, 1, 9, 7, 8, 1, 7, 1, 13, 7, 10, 4, 9, 1, 7, 4, 14, 1, 8, 5
Offset: 1
Keywords
Examples
The prime indices of 33 are {2,5}, with combinations 2 = 2 4 = 2+2 5 = 5 6 = 2+2+2 7 = 5+2 Hence a(33) = 5.
Crossrefs
Programs
-
Mathematica
prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]]; combs[n_,y_]:=With[{s=Table[{k,i},{k,y},{i,0,Floor[n/k]}]},Select[Tuples[s],Total[Times@@@#]==n&]]; Table[Length[Select[Range[Total[prix[n]]],combs[#,prix[n]]!={}&]],{n,30}]
Formula
a(2n) = A056239(2n) - 1 for n > 0.
Comments