OFFSET
1,1
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
a(5)=17 as 18 is a practical number, 18-1=17 and it is the 5th such prime.
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]]];
Select[Table[Prime[n]+1, {n, 1, 200}], PracticalQ]-1 (* using T. D. Noe's program A005153 *)
PROG
(PARI) isPractical(n)={
if(n%2, return(n==1));
my(f=factor(n), P=1);
for(i=1, #f[, 1]-1,
P*=sigma(f[i, 1]^f[i, 2]);
if(f[i+1, 1]>P+1, return(0))
);
n>0
};
select(p->isPractical(p+1), primes(300)) \\ Charles R Greathouse IV, May 03 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Frank M Jackson, May 02 2013
STATUS
approved