Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I M0665 #81 Mar 27 2024 08:08:18
%S 2,3,5,7,11,17,23,31,47,53,71,107,127,191,383,431,647,863,971,1151,
%T 2591,4373,6143,6911,8191,8747,13121,15551,23327,27647,62207,73727,
%U 131071,139967,165887,294911,314927,442367,472391,497663,524287,786431,995327
%N Class 1+ primes: primes of the form 2^i*3^j - 1 with i, j >= 0.
%C The definition is given by Guy: a prime p is in class 1+ if the only prime divisors of p + 1 are 2 or 3; and p is in class r+ if every prime factor of p + 1 is in some class <= r+ + 1, with equality for at least one prime factor. - _N. J. A. Sloane_, Sep 22 2012
%C See A005109 for the definition of class r- primes.
%C Odd terms are primes satisfying p==-1 (mod phi(p+1)). - _Benoit Cloitre_, Feb 22 2002
%C These are the primes p for which p+1 is 3-smooth. Primes for which either p+1 or p-1 have many small factors are more easily proved prime, so most of the largest primes found have this property. - _Michael B. Porter_, Feb 19 2013
%C For n>1, x=2*a(n) is a solution to the equation phi(sigma(x)) = x-phi(x). Also all Mersenne primes are in the sequence. - _Jahangeer Kholdi_, Sep 28 2014
%D R. K. Guy, Unsolved Problems in Number Theory, A18.
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H Ray Chandler, <a href="/A005105/b005105.txt">Table of n, a(n) for n = 1..7170</a> (terms < 10^1000; terms 1..691 from T. D. Noe, terms 692..5000 from Charles R Greathouse IV)
%H C. K. Caldwell, <a href="http://www.utm.edu/research/primes/">The Prime Pages</a>.
%H G. Everest, P. Rogers and T. Ward, <a href="https://ueaeprints.uea.ac.uk/19707/">A higher-rank Mersenne problem</a>, pp. 95-107 of ANTS 2002, Lect. Notes Computer Sci. 2369 (2002).
%H R. J. Mathar, <a href="/A005105/a005105.txt">Maple programs to generate b-files for b005105 to b005108, b081633 etc.</a>
%H <a href="/index/Pri#primes_Erdos_Selfridge">Index entries for sequences related to the Erdos-Selfridge classification</a>
%F {primes p : A126433(PrimePi(p)) = 1 }. - _R. J. Mathar_, Sep 24 2012
%e 23 is in the sequence since 23 is prime and 23 + 1 = 24 = 2^3 * 3 has all prime factors less than or equal to 3.
%p For Maple program see Mathar link.
%p # Alternative:
%p N:= 10^6: # to get all terms <= N
%p select(isprime,{seq(seq(2^i*3^j-1, i=0..ilog2(N/3^j)), j=0..floor(log[3](N)))});
%p # if using Maple 11 or earlier, uncomment the following line
%p # sort(convert(%,list)); # _Robert Israel_, Sep 28 2014
%t mx = 10^6; Select[ Sort@ Flatten@ Table[2^i*3^j - 1, {i, 0, Log[2, mx]}, {j, 0, Log[3, mx/2^i]}], PrimeQ] (* or *)
%t Prime[ Select[ Range[78200], Mod[ Prime[ # ] + 1, EulerPhi[ Prime[ # ] + 1]] == 0 &]] (* or *)
%t PrimeFactors[n_Integer] := Flatten[ Table[ #[[1]], {1}] & /@ FactorInteger[n]]; f[n_Integer] := Block[{m = n}, If[m == 0, m = 1, While[ IntegerQ[m/2], m /= 2]; While[ IntegerQ[m/3], m /= 3]]; Apply[Times, PrimeFactors[m] + 1]]; ClassPlusNbr[n_] := Length[ NestWhileList[f, n, UnsameQ, All]] - 3; Prime[ Select[ Range[3, 78200], ClassPlusNbr[ Prime[ # ]] == 1 &]]
%o (PARI) list(lim)=my(v=List(), N); lim=1+lim\1; for(n=0, logint(lim,3), N=3^n; while(N<=lim, if(ispseudoprime(N-1),listput(v, N-1)); N<<=1)); Set(v) \\ _Charles R Greathouse IV_, Jul 15 2011; corrected Sep 22 2015
%o (Magma) [p: p in PrimesUpTo(6*10^6) | forall{d: d in PrimeDivisors(p+1) | d le 3}]; // _Bruno Berselli_, Sep 24 2012
%o (GAP)
%o A:=Filtered([1..10^7],IsPrime);; I:=[3];;
%o B:=List(A,i->Elements(Factors(i+1)));;
%o C:=List([0..Length(I)],j->List(Combinations(I,j),i->Concatenation([2],i)));;
%o A005105:=Concatenation([2],List(Set(Flat(List([1..Length(C)],i->List([1..Length(C[i])],j->Positions(B,C[i][j]))))),i->A[i])); # _Muniru A Asiru_, Sep 28 2017
%Y Cf. A069353, A069356, A005109, A005108, A019434, A000668, A000040, A003586, A129469.
%K nonn
%O 1,1
%A _N. J. A. Sloane_, _Simon Plouffe_
%E More terms from _Benoit Cloitre_, Feb 22 2002
%E Edited and extended by _Robert G. Wilson v_, Mar 20 2003