OFFSET
1,2
FORMULA
EXAMPLE
For n=11, the 11th practical number is 28. As 2+8 = 10 and 1+0 = 1, the digital root is 1.
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]]]; Mod[ Select[ Range@ 500, PracticalQ], 9] /. {0 -> 9} (* Robert G. Wilson v, Aug 02 2010 *)
PROG
(PARI) isok(n) = bittest(n, 0) && return(n==1); my(P=1); n && !for(i=2, #n=factor(n)~, n[1, i]>1+(P*=sigma(n[1, i-1]^n[2, i-1])) && return);
for(n=1, 1e3, if(isok(n), print1((n-1)%9+1", "))) \\ Altug Alkan, Nov 12 2015
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jason G. Wurtzel, Jul 23 2010
EXTENSIONS
More terms from Robert G. Wilson v, Aug 02 2010
STATUS
approved