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-1 of 1 results.

A293194 Primes of the form 2^q * 3^r * 5^s - 1.

Original entry on oeis.org

2, 3, 5, 7, 11, 17, 19, 23, 29, 31, 47, 53, 59, 71, 79, 89, 107, 127, 149, 179, 191, 199, 239, 269, 359, 383, 431, 449, 479, 499, 599, 647, 719, 809, 863, 971, 1151, 1249, 1279, 1439, 1499, 1619, 1999, 2399, 2591, 2699, 2879, 2999, 4049, 4373, 4799, 4999, 5119, 5399, 6143, 6911
Offset: 1

Views

Author

Muniru A Asiru, Oct 02 2017

Keywords

Comments

Mersenne primes A000668 occur when (q, r, s) = (q, 0, 0) with q > 0.
a(2) = 3 is a Mersenne prime but a(3) = 7 is not.
For n > 2, all terms = {1, 5} mod 6.

Examples

			3 is a member because 3 is a prime number and 2^2 * 3^0 * 5^0 - 1 = 3.
89 is a member because 89 is a prime number and 2^1 * 3^2 * 5^1 - 1 = 89.
list of (q, r, s): (0, 1, 0), (2, 0, 0), (1, 1, 0), (3, 0, 0), (2, 1, 0), (1, 2, 0), (2, 0, 1), (3, 1, 0),(1, 1, 1), (5, 0, 0), (4, 1, 0), (1, 3, 0), (2, 1, 1), ...
		

Crossrefs

Programs

  • GAP
    K := 10^5 + 1;; # to get all terms less than or equal to K
    A := Filtered([1 .. K], IsPrime);; I := [3, 5];;
    B := List(A, i -> Elements(Factors(i + 1)));;
    C := List([0 .. Length(I)], j -> List(Combinations(I, j), i -> Concatenation([2], i)));
    A293194 := Concatenation([2], List(Set(Flat(List([1 .. Length(C)], i -> List([1 .. Length(C[i])], j -> Positions(B, C[i][j]))))), i -> A[i]));
    
  • Maple
    N:= 10^6: # to get all terms <= N
    R:= {}:
    for c from 0 to floor(log[5]((N+1))) do
      for b from 0 to floor(log[3]((N+1)/5^c)) do
         R:= R union select(isprime, {seq(2^a*3^b*5^c-1,
             a=0..ilog2((N+1)/(3^b*5^c)))})
    od od:
    sort(convert(R,list)); # Robert Israel, Oct 15 2017
  • Mathematica
    With[{n = 7000}, Sort@ Select[Flatten@ Table[2^q * 3^r * 5^s - 1, {q, 0, Log[2, n/(1)]}, {r, 0, Log[3, n/(2^q)]}, {s, 0, Log[5, n/(2^q * 3^r)]}], PrimeQ]] (* Michael De Vlieger, Oct 02 2017 *)
  • PARI
    lista(nn) = {forprime(p=2,nn, if (vecmax(factor(p+1)[,1]) <= 5, print1(p, ", ")););} \\ Michel Marcus, Oct 06 2017
    
  • Python
    from itertools import count, islice
    from sympy import integer_log, isprime
    def A293194_gen(): # generator of terms
        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):
            c = x
            for i in range(integer_log(x,5)[0]+1):
                for j in range(integer_log(m:=x//5**i,3)[0]+1):
                    c -= (m//3**j).bit_length()
            return c
        yield from filter(isprime,(bisection(lambda k:n+f(k),n,n)-1 for n in count(1)))
    A293194_list = list(islice(A293194_gen(),30)) # Chai Wah Wu, Mar 31 2025
Showing 1-1 of 1 results.