OFFSET
1,2
COMMENTS
EXAMPLE
a(5)=12 as 12 is a practical number and 12+1=13 is prime. It is the 5th such practical number.
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] (* using T. D. Noe's program A005153 *)
PROG
(PARI) is(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);
forprime(p=2, 1000, if(is(p-1), print1(p-1", "))) \\ Altug Alkan, Nov 16 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Frank M Jackson, Nov 16 2015
STATUS
approved