Sphenic Number

Author

Eric W. Weisstein
April 30, 2014

This notebook downloaded from http://mathworld.wolfram.com/notebooks/IntegerSequences/SphenicNumber.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/SphenicNumber.html.

©2014 Wolfram Research, Inc. except for portions noted otherwise

Code

SphenicQ[n_Integer]:=Block[{fac=FactorInteger[n,4]},
fac[[All,-1]]==={1,1,1}
]

Compute

l1=With[{t=135,max=38},Take[Union[Flatten[Table[Prime[n]*Prime[m]*Prime[k],{k,max},{n,k+1,max},{m,n+1,max}]]],t]]

l2=With[{t=135,max=38},Take[Union[Flatten[Table[Prime[i]*Prime[j]*Prime[k],{i,3,max},{j,2,i-1},{k,j-1}]]],t]]

l3=Select[Range[1000],SphenicQ]

l1==l2==l3

Timings

Length[Select[Range[10^6],SphenicQ]]//Timing

Length[Select[Range[10^6],Sphenic2Q]]//Timing