cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-4 of 4 results.

A005105 Class 1+ primes: primes of the form 2^i*3^j - 1 with i, j >= 0.

Original entry on oeis.org

2, 3, 5, 7, 11, 17, 23, 31, 47, 53, 71, 107, 127, 191, 383, 431, 647, 863, 971, 1151, 2591, 4373, 6143, 6911, 8191, 8747, 13121, 15551, 23327, 27647, 62207, 73727, 131071, 139967, 165887, 294911, 314927, 442367, 472391, 497663, 524287, 786431, 995327
Offset: 1

Views

Author

Keywords

Comments

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
See A005109 for the definition of class r- primes.
Odd terms are primes satisfying p==-1 (mod phi(p+1)). - Benoit Cloitre, Feb 22 2002
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
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

Examples

			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.
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, A18.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • GAP
    A:=Filtered([1..10^7],IsPrime);;     I:=[3];;
    B:=List(A,i->Elements(Factors(i+1)));;
    C:=List([0..Length(I)],j->List(Combinations(I,j),i->Concatenation([2],i)));;
    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
    
  • Magma
    [p: p in PrimesUpTo(6*10^6) | forall{d: d in PrimeDivisors(p+1) | d le 3}]; // Bruno Berselli, Sep 24 2012
    
  • Maple
    For Maple program see Mathar link.
    # Alternative:
    N:= 10^6: # to get all terms <= N
    select(isprime,{seq(seq(2^i*3^j-1, i=0..ilog2(N/3^j)), j=0..floor(log[3](N)))});
    # if using Maple 11 or earlier, uncomment the following line
    # sort(convert(%,list));  # Robert Israel, Sep 28 2014
  • Mathematica
    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 *)
    Prime[ Select[ Range[78200], Mod[ Prime[ # ] + 1, EulerPhi[ Prime[ # ] + 1]] == 0 &]] (* or *)
    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 &]]
  • 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
    
  • Python
    from itertools import count, islice
    from sympy import integer_log, isprime
    def A069353(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+x-sum(((x+1)//3**i).bit_length() for i in range(integer_log(x+1,3)[0]+1))
        return bisection(f,n-1,n-1)
    def A005105_gen(): # generator of terms
        return filter(lambda n:isprime(n), map(A069353,count(1)))
    A005105_list = list(islice(A005105_gen(),30)) # Chai Wah Wu, Mar 31 2025

Formula

{primes p : A126433(PrimePi(p)) = 1 }. - R. J. Mathar, Sep 24 2012

Extensions

More terms from Benoit Cloitre, Feb 22 2002
Edited and extended by Robert G. Wilson v, Mar 20 2003

A069346 Primes of the form n - Omega(n), where Omega(n) is the number of prime factors of n, A001222(n).

Original entry on oeis.org

2, 5, 7, 13, 17, 19, 23, 31, 37, 41, 43, 47, 53, 67, 73, 83, 89, 103, 107, 109, 113, 127, 131, 139, 151, 157, 163, 167, 179, 181, 199, 211, 227, 233, 239, 241, 251, 257, 263, 281, 283, 293, 307, 311, 313, 317, 337, 347, 353, 359
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 18 2002

Keywords

Comments

The representation is ambiguous, see A069347.

Examples

			a(10) = 41 = A069345(44) = 44-3 (as 44 = 2*2*11).
		

Crossrefs

Programs

  • Mathematica
    Select[Table[n - PrimeOmega[n], {n, 1, 400}], PrimeQ] // Union (* Jean-François Alcover, Jun 08 2013 *)
  • PARI
    is(n)=for(k=1, log(n)\log(2)+1, if(bigomega(n+k)==k, return(isprime(n)))); 0 \\ Charles R Greathouse IV, Dec 10 2013

A069355 Numbers of form 2^i*3^j - (i+j) with i, j >= 0.

Original entry on oeis.org

1, 2, 4, 5, 7, 9, 12, 15, 20, 24, 27, 32, 43, 50, 58, 67, 77, 90, 103, 121, 138, 157, 185, 210, 238, 248, 281, 318, 376, 425, 480, 503, 568, 641, 723, 759, 856, 965, 1014, 1143, 1288, 1451, 1526, 1719, 1936, 2037, 2180, 2294, 2583, 2908, 3061, 3446, 3879, 4084
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 18 2002

Keywords

Comments

Distinct values of A003586(m)-A069352(m) or of A069345(A003586(m)). - Michel Marcus, Apr 09 2018

Examples

			1 is a term because 2^0*3^0 - (0+0) = 2^1*3^0 - (1+0) = 1.
2 is a term because 2^2*3^0 - (2+0) = 2^0*3^1 - (0+1) = 2.
4 is a term because 2^1*3^1 - (1+1) = 4.
		

Crossrefs

Programs

  • Mathematica
    With[{nn=20},Take[Flatten[Table[2^i 3^j-i-j,{i,0,nn},{j,0,nn}]]//Union,60]] (* Harvey P. Dale, Aug 29 2022 *)

Extensions

Duplicated term 2 and incorrect formula removed by Altug Alkan, Apr 09 2018

A069358 Primes of the form 2^i*3^j + (i+j) with i, j >= 0.

Original entry on oeis.org

3, 11, 37, 53, 113, 167, 199, 439, 521, 3083, 6569, 12301, 23339, 32783, 139981, 663569, 708601, 3981331, 7558289, 20155411, 38263769, 45349651, 75497497, 483729431, 1934917657, 2717909021, 6115295261, 12397455671, 14693280793
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 18 2002

Keywords

Crossrefs

Programs

  • Mathematica
    Take[ Select[ Union[ Flatten[ Table[2^i*3^j + (i + j), {i, 0, 25}, {j, 0, 18}]]], PrimeQ[ # ] &], 30]

Extensions

Edited and extended by Robert G. Wilson v, May 09 2003
Showing 1-4 of 4 results.