A prime p is classified by factorizing p+1 into primes, then on each of those primes q factorizing q+1, and so on, repeating until reaching entirely 2s and 3s. p=2 or p=3 interchange on factorizing p+1 (2+1=3 and 3+1=2*2).

A prime p where p+1 factorizes to all 2s or 3s is class 1. For example i=11 has 11+1=12=2*2*3 which is all 2s and 3s so class 1. 2 and 3 themselves are class 1 too, since their p+1 factorizing gives 2s and 3s.

Further primes are classified by how many iterations of the p+1 factorizing is necessary to reach 2s and 3s. For example prime p=3847 is iterated as

Math-NumSeq is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

Math-NumSeq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.