OFFSET
1,6
COMMENTS
LINKS
MAPLE
A126433 := proc(n)
option remember;
local p, pf, e, a;
if isprime(n) then
pf := ifactors(n+1)[2];
a := 1;
for e from 1 to nops(pf) do
p := op(1, op(e, pf));
if p > 3 then
a := max(a, procname(p)+1);
end if;
end do;
a ;
else
-1;
end if;
end proc:
seq(A126433(ithprime(n)), n=1..100) ;
A126433 := n -> if n>0 then A126433(-ithprime(n)) else numtheory[factorset](1-n); if % subset{2, 3} then 1 else 1+max(seq(A126433(-i), i=%)) fi fi; map(%, [$1..999]); # M. F. Hasler, Apr 02 2007
MATHEMATICA
classPlus[p_] := classPlus[p] = If[f = FactorInteger[p + 1][[All, 1]]; q = Last[f]; q == 2 || q == 3, 1, Max[classPlus /@ f] + 1]; classPlus /@ Prime /@ Range[105] (* Jean-François Alcover, Jun 24 2013 *)
PROG
CROSSREFS
KEYWORD
nonn
AUTHOR
R. J. Mathar, Mar 23 2007
STATUS
approved