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

A293199 Primes of the form 2^q * 3^r * 7^s - 1.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 23, 31, 41, 47, 53, 71, 83, 97, 107, 127, 167, 191, 223, 251, 293, 383, 431, 503, 587, 647, 863, 881, 971, 1151, 1511, 1567, 2267, 2351, 2591, 2687, 3023, 3527, 3583, 4373, 4703, 4801, 6047, 6143
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) = 5 is not.
For n > 2, all terms = {1, 5} mod 6.

Examples

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

Crossrefs

Programs

  • GAP
    K:=10^5+1;; # to get all terms <=K
    A:=Filtered([1..K],IsPrime);; I:=[3,7];;
    B:=List(A,i->Elements(Factors(i+1)));;
    C:=List([0..Length(I)],j->List(Combinations(I,j),i->Concatenation([2],i)));
    A293199:=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^4: # for terms <= N
    S:= {1}:
    for p in {2,3,7} do S:= map(proc(s) local i; seq(s*p^i,i=0..floor(log[p](N/s))) end proc, S) od:
    sort(convert(select(isprime,map(`-`,S,1)),list)); # Robert Israel, Dec 17 2020

A293425 Primes of the form 2^a * 3^b * 5^c - 1 for positive a, b, c.

Original entry on oeis.org

29, 59, 89, 149, 179, 239, 269, 359, 449, 479, 599, 719, 809, 1439, 1499, 1619, 2399, 2699, 2879, 2999, 4049, 4799, 5399, 7499, 8999, 9719, 10799, 11519, 12149, 12959, 13499, 15359, 18749, 20249, 21599, 23039, 25919, 33749, 35999, 40499, 51839, 56249, 59999, 65609, 67499, 69119, 71999
Offset: 1

Views

Author

Muniru A Asiru, Oct 09 2017

Keywords

Comments

a(n) is congruent to 29 (mod 30).

Examples

			a(1) = 29 = 2^1 * 3^1 * 5^1 - 1.
a(2) = 59 = 2^2 * 3^1 * 5^1 - 1.
a(3) = 89 = 2^1 * 3^2 * 5^1 - 1.
a(4) = 149 = 2^1 * 3^1 * 5^2 - 1.
a(5) = 179 = 2^2 * 3^2 * 5^1 - 1.
list of (a, b, c): (1, 1, 1), (2, 1, 1), (1, 2, 1), (1, 1, 2), (2, 2, 1), (4, 1, 1), (1, 3, 1), (3, 2, 1), (1, 2, 2), (5, 1, 1), (3, 1, 2), (4, 2, 1), (1, 4, 1), (5, 2, 1), (2, 1, 3), (2, 4, 1), ...
		

Crossrefs

Programs

  • GAP
    K:=10^5+1;; # to get all terms <= K.
    A:=Filtered([1..K],IsPrime);;
    A293425:=List(Positions(List(A,i->Elements(Factors(i+1))),[2,3,5]),i->A[i]);
    
  • Maple
    N:= 10^6: # to get all terms < N
    R:= {}:
    for c from 1 to floor(log[5]((N+1)/6)) do
    for b from 1 to floor(log[3]((N+1)/2/5^c)) do
         R:= R union select(isprime, {seq(2^a*3^b*5^c-1,
                 a=1..ilog2((N+1)/(3^b*5^c)))})
    od od:
    sort(convert(R,list)); # Robert Israel, Oct 15 2017
  • Mathematica
    With[{n = 10^5}, Sort@ Select[Flatten@ Table[2^a*3^b*5^c - 1, {a, Log2@ n}, {b, Log[3, n/(2^a)]}, {c, Log[5, n/(2^a*3^b)]}], PrimeQ]] (* Michael De Vlieger, Oct 11 2017 *)
  • PARI
    lista(nn) = {forprime(p=2,nn, f = factor(p+1); if ((vecmax(f[,1]) <= 5) && (#f~==3), print1(p, ", ")););} \\ Michel Marcus, Oct 09 2017
    
  • Python
    from itertools import count, islice
    from sympy import integer_log, isprime
    def A293425_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(1,integer_log(x,5)[0]+1):
                for j in range(1,integer_log(m:=x//5**i,3)[0]+1):
                    c -= (m//3**j).bit_length()-1
            return c
        yield from filter(isprime,(bisection(lambda k:n+f(k),n,n)-1 for n in count(1)))
    A293425_list = list(islice(A293425_gen(),30)) # Chai Wah Wu, Mar 31 2025

A347977 Primes of the form 2^p * 3^q * 5^r * 7^s - 1.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 41, 47, 53, 59, 71, 79, 83, 89, 97, 107, 127, 139, 149, 167, 179, 191, 199, 223, 239, 251, 269, 293, 349, 359, 383, 419, 431, 449, 479, 499, 503, 587, 599, 647, 719, 809, 839, 863, 881, 971, 1049, 1151, 1249, 1259, 1279, 1399, 1439, 1499, 1511, 1567, 1619, 1889
Offset: 1

Views

Author

Flávio V. Fernandes, Sep 21 2021

Keywords

Comments

Restricting to r = s = 0 gives A005105; s = 0 gives A293194.
Primes of the form A002473(k) - 1.

Examples

			251 = 2^2 * 3^2 * 5^0 * 7^1 - 1 and 839 = 2^3 * 3^1 * 5^1 * 7^1 - 1 are terms.
		

Crossrefs

Programs

  • Mathematica
    With[{n = 2000}, Sort@ Select[Flatten@ Table[2^p * 3^q * 5^r * 7^s - 1, {p, 0, Log[2, n]}, {q, 0, Log[3, n/(2^p)]}, {r, 0, Log[5, n/(2^p * 3^q)]}, {s, 0, Log[7, n/(2^p * 3^q * 5^r)]}], PrimeQ]] (* Amiram Eldar, Sep 25 2021 after Michael De Vlieger at A293194 *)
  • PARI
    isok(p) = isprime(p) && (vecmax(factor(p+1)[,1]) < 11); \\ Michel Marcus, Nov 10 2021
    
  • PARI
    upto(limit)={my(P=[2,3,5,7]); local(L=List()); my(recurse(k,t) = if(t<=limit+1, if(k>#P, if(isprime(t-1), listput(L,t-1)), my(b=P[k]); for(e=0, logint(limit+1,b), self()(k+1, t*b^e))))); recurse(1, 1); vecsort(Vec(L))} \\ Andrew Howroyd, Nov 20 2021
    
  • Python
    from itertools import count, islice
    from sympy import integer_log, isprime
    def A347977_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,7)[0]+1):
                for j in range(integer_log(m:=x//7**i,5)[0]+1):
                    for k in range(integer_log(r:=m//5**j,3)[0]+1):
                        c -= (r//3**k).bit_length()
            return c
        yield from filter(isprime,(bisection(lambda k:n+f(k),n,n)-1 for n in count(1)))
    A347977_list = list(islice(A347977_gen(),30)) # Chai Wah Wu, Mar 31 2025

A373464 Largest of a quadruple of primes p[1..4] such that (p[k]+1, k=1..4) is in geometric progression.

Original entry on oeis.org

23, 47, 107, 191, 499, 647, 719, 809, 863, 1249, 1439, 1999, 2591, 2879, 3023, 3779, 4079, 5323, 6911, 7039, 7127, 7559, 8231, 8231, 8747, 9839, 10289, 10289, 10499, 10499, 10529, 10691, 11279, 11519, 12959, 13229, 13309, 13999, 15551, 15551, 15971, 18143, 19207
Offset: 1

Views

Author

M. F. Hasler, Jul 12 2024

Keywords

Comments

a(10) = 1249 is the first term not in A299171, a(15) = 3023 is the first term not in A293194, a(17) = 4079 is the first term not in A347977 and also the first term not in A374482, and a(21) = 7127 is the first term not in A184856.

Examples

			The terms of the sequence are column "p[4]" in the following table which lists the sequences of primes, and ratios of the geometric progression (p[k]+1):
   n  | p[1], p[2], p[3], p[4]  |  r = (p[k+1]+1) / (p[k]+1)
------+-------------------------+---------------------------
   1  |    2,    5,   11,   23  |  2 = 6/3 = 12/6 = 24/12
   2  |    5,   11,   23,   47  |  2 = 12/6 = 24/12 = 48/24
   3  |   31,   47,   71,  107  |  3/2 = 48/32 = 72/48 = 108/72
   4  |    2,   11,   47,  191  |  4 = 12/3 = 48/12 = 192/48
   5  |   31,   79,  199,  499  |  5/2 = 80/32 = 200/80 = 500/200
   6  |    2,   17,  107,  647  |  6 = 18/3 = 108/18 = 648/108
   7  |   89,  179,  359,  719  |  2 = 180/90 = ...
   8  |   29,   89,  269,  809  |  3 = 90/30 = ...
   9  |  499,  599,  719,  863  |  6/5 = 600/500 = ...
  10  |   79,  199,  499, 1249  |  5/2 = 200/80 = ...
  11  |  179,  359,  719, 1439  |  2 = 360/180 = ...
  12  |   53,  179,  599, 1999  |  10/3 = 180/54 = ...
		

Crossrefs

Subsequence of A089199 (primes p such that p+1 is divisible by a cube).

Programs

  • PARI
    A373464_upto(N, show=0, D = 1, LIM=N\2) = { my(L=List()); forprime(p=1, LIM, my(denom = p+D); for(numer=denom+1, sqrtnint((N+D) * denom^2, 3), my(r=numer/denom); for(k=1,3, (type(denom * r^k)=="t_INT" && isprime(denom * r^k - D)) || next(2)); listput(L, denom * r^3 - D); show && printf(" | %4d, %4d, %4d, %4d | %s\n",denom-D, denom*r-D, denom*r^2-D, denom*r^3-D, numer/denom))); vecsort(L)}
    
  • Python
    from itertools import islice
    from fractions import Fraction
    from sympy import nextprime
    def A373464_gen(): # generator of terms
        p, plist, pset = 1, [], set()
        while True:
            p = nextprime(p)
            for q in plist:
                r = Fraction(q+1,p+1)
                q2 = r*(q+1)-1
                if q2 < 2:
                    break
                if q2.denominator == 1:
                    q2 = int(q2)
                    if q2 in pset:
                        q3 = r*(q2+1)-1
                        if q3 < 2:
                            break
                        if q3.denominator == 1 and int(q3) in pset:
                            yield p
            plist = [p]+plist
            pset.add(p)
    A373464_list = list(islice(A373464_gen(),20)) # Chai Wah Wu, Jul 16 2024

Extensions

a(26)-a(43) from Chai Wah Wu, Jul 16 2024

A293074 Primes of the form 2^q * 3^r * 11^s - 1.

Original entry on oeis.org

2, 3, 5, 7, 11, 17, 23, 31, 43, 47, 53, 71, 107, 127, 131, 191, 197, 241, 263, 383, 431, 593, 647, 863, 967, 971, 1151, 1187, 1451, 1583, 2111, 2591, 2903, 3167, 4373, 4751, 5323, 5807, 6143, 6911, 7127, 8191, 8447, 8747, 10691, 12671, 13121, 15551, 15971, 21383, 23327
Offset: 1

Views

Author

Muniru A Asiru, Oct 01 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) = 5 is not a Mersenne prime.
For n > 2, all terms = {1, 5} mod 6.

Examples

			3 = a(2) = 2^2 * 3^0 * 11^0 - 1.
131 = a(15) = 2^2 * 3^1 * 11^1 - 1.
list of (q, r, s): (0, 1, 0), (2, 0, 0), (1, 1, 0), (3, 0, 0), (2, 1, 0), (1, 2, 0), (3, 1, 0), (5, 0, 0), (2, 0, 1), (4, 1, 0), (1, 3, 0), ...
		

Crossrefs

Cf. A000668, A005105, Primes of the form 2^q * 3^r * b^s - 1: A293194 (b = 5), A293199 (b = 7).

Programs

  • GAP
    K:=10^5+1;; # to get all terms <= K.
    A:=Filtered([1..K],IsPrime);;    I:=[3,11];;
    B:=List(A,i->Elements(Factors(i+1)));;
    C:=List([0..Length(I)],j->List(Combinations(I,j),i->Concatenation([2],i)));;
    A293074:=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^5: # to get all terms < N
    S:=select(isprime, {seq(seq(seq(2^q*3^r*11^s-1, q=0..ilog2(floor(N/3^r/11^s))),r=0..floor(log[3](N/11^s))),s=0..floor(log[11](N)))}):
    sort(convert(S,list)); # Robert Israel, Oct 03 2017
  • Mathematica
    With[{nn=20},Take[Select[Union[Flatten[Table[2^q 3^r 11^s-1,{q,0,nn},{r,0,nn},{s,0,nn}]]],PrimeQ],60]] (* Harvey P. Dale, May 12 2019 *)
Showing 1-5 of 5 results.