OFFSET
1,1
COMMENTS
The first five terms are the only primes in both class 1+ and class 1-. The Mathematica program assigns 2 and 3 to class 0 in order to simplify the algorithm; they are actually in classes 1- and 1+.
MATHEMATICA
classp[2]=0; classp[3]=0; SetAttributes[classp, Listable]; classp[p_] := classp[p] = 1+Max@@classp[First/@FactorInteger[p+1]]; classm[2]=0; classm[3]=0; SetAttributes[classm, Listable]; classm[p_] := classm[p] = 1+Max@@classm[First/@FactorInteger[p-1]]; Select[Prime[Range[1000]], classp[ # ]==classm[ # ]&]
CROSSREFS
KEYWORD
nonn
AUTHOR
T. D. Noe, May 26 2010
STATUS
approved