OFFSET
1,1
LINKS
Wikipedia, Practical number.
Wikipedia, "Complete" sequence. [Wikipedia calls a sequence "complete" (sic) if every positive integer is a sum of distinct terms. This name is extremely misleading and should be avoided. - N. J. A. Sloane, May 20 2023]
EXAMPLE
a(1)=78 because it is practical. It has divisors 1, 2, 3, 6, 13, 26, 39, 78, and 13/6 > 2. This is the first occurrence.
MATHEMATICA
PracticalQ[n_] := Module[{f, p, e, prod=1, ok=True}, If[n<1||(n>1&&OddQ[n]), False, If[n==1, True, f=FactorInteger[n]; {p, e}=Transpose[f]; Do[If[p[[i]]>1+DivisorSigma[1, prod], ok=False; Break[]]; prod = prod*p[[i]]^e[[i]], {i, Length[p]}]; ok]]]; Dens2DivQ[n_] := Module[{lst=Divisors[n]}, Do[ok=False; If[lst[[m+1]]/lst[[m]]>2, Break[]]; ok=True, {m, 1, Length[lst]-1}]; ok]; Select[Range[10000], PracticalQ[#]&&!Dens2DivQ[#] &]
CROSSREFS
KEYWORD
nonn
AUTHOR
Frank M Jackson, Jul 27 2018
STATUS
approved