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.

A073917 Smallest prime which leaves a remainder 1 when divided by primorial(n), i.e., when divided by first n primes.

Original entry on oeis.org

3, 7, 31, 211, 2311, 120121, 4084081, 106696591, 892371481, 71166625531, 200560490131, 29682952539241, 2129751844690471, 78496567990020181, 8608456956238879741, 97767475431570134191, 9613801750771063195351
Offset: 1

Views

Author

Amarnath Murthy, Aug 18 2002

Keywords

Comments

Let Pr(n) = the product of first n primes. Then a(n) is the smallest prime of the form k*Pr(n) + 1. k = 1 for first five terms.
Smallest prime p such that the prime factorization of p-1 contains the first n primes. - R. J. Mathar, Jul 03 2012

Crossrefs

Cf. A002110 (primorials), A073915, A103783, A214089.
Cf. A076689 (values of k).

Programs

  • PARI
    a(n)=if(n<0,0,s=1; while(prime(s)%prod(i=1,n, prime(i))>1,s++); s)

Extensions

More terms from Vladeta Jovovic, Aug 20 2002

A214089 Least prime p such that the first n primes divide p^2-1.

Original entry on oeis.org

3, 5, 11, 29, 419, 1429, 1429, 315589, 1729001, 57762431, 1724478911, 6188402219, 349152569039, 1430083494841, 390499187164241, 1010518715554349, 18628320726623609, 522124211958421799, 522124211958421799, 5936798290039408015951, 311263131154464891496249
Offset: 1

Views

Author

Robin Garcia, Jul 02 2012

Keywords

Comments

(a(n)^2 - 1) / A002110(n) is congruent to 0 (mod 4). (a(n)^2 - 1) / (4*A002110(n)) = A215085(n). [J. Stauduhar, Aug 03 2012]
a(n) == +1 or -1 (mod prime(i)) for every i=1,2,...,n. The system of congruences x == +1 or -1 (mod prime(i)), i=1,2,...,n, has 2^(n-1) solutions modulo A002110(n) so that a(n) represents the smallest prime in the corresponding residue classes, allowing efficient computation (see PARI program). - Max Alekseyev, Aug 22 2012

Examples

			a(5) = 419: 419^2-1 = 175560 = 2^3*3*5*7*11*19 contains the first 5 primes.
a(7) = 1429:  1428=2^2*3*7*17, 1430=2*5*11*13 contains the first 7 primes.
a(8) = 315589: 315589^2-1 = 2^3*3*5*7*11*13*17^2*19*151 contains the first 8 primes.
		

Crossrefs

Programs

  • Maple
    A214089 := proc(n)
         local m,k,p;
       m:= 2*mul(ithprime(j),j=1..n);
       for k from 1 do
         p:= sqrt(m*k+1);
         if type(p,integer) and isprime(p) then return(p)
         end if
       end do
    end proc;
    # Robert Israel, Aug 19 2012
  • Mathematica
    f[n_] := Block[{k = 1, p = Times @@ Prime@Range@n}, While[! IntegerQ@Sqrt[4 k*p + 1], k++]; Block[{j = k}, While[! PrimeQ[Sqrt[4 j*p + 1]], j++]; Sqrt[4 j*p + 1]]]; Array[f, 10] (* J. Stauduhar, Aug 18 2012 *)
  • PARI
    A214089(n) = {
            local(a,k=4,p) ;
            a=prod(j=1,n,prime(j)) ;
            while(1,
                    if( issquare(k*a+1, &p),
                            if(isprime(p),
                                    return(p);
                            ) ;
                    ) ;
                    k+=4;
            ) ;
    } ;
    
  • PARI
    { a(n) = local(B,q); B=prod(i=1,n,prime(i))^2; forvec(v=vector(n-1,i,[0,1]), q=chinese(concat(vector(n-1,i,Mod((-1)^v[i],prime(i+1))),[Mod(1,2)])); forstep(s=lift(q),B-1,q.mod,if(ispseudoprime(s),B=s;break)) ); B } /* Max Alekseyev, Aug 22 2012 */
    
  • Python
    from itertools import product
    from sympy import sieve, prime, isprime
    from sympy.ntheory.modular import crt
    def A214089(n): return 3 if n == 1 else int(min(filter(isprime,(crt(tuple(sieve.primerange(prime(n)+1)), t)[0] for t in product((1,-1),repeat=n))))) # Chai Wah Wu, May 31 2022

Extensions

a(15)-a(16) from Donovan Johnson, Jul 25 2012
a(17) from Charles R Greathouse IV, Aug 08 2012
a(18) from Charles R Greathouse IV, Aug 16 2012
a(19) from J. Stauduhar, Aug 18 2012
a(20)-a(32) from Max Alekseyev, Aug 22 2012

A103784 Minimal n that makes primorial P(k)*n-1 prime, k>=2, n>0.

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 2, 3, 6, 3, 2, 1, 18, 3, 7, 13, 11, 24, 2, 13, 2, 16, 1, 4, 29, 6, 18, 4, 2, 11, 14, 13, 38, 13, 14, 9, 17, 12, 13, 10, 31, 19, 5, 58, 5, 15, 22, 18, 8, 5, 11, 27, 24, 13, 10, 11, 3, 36, 18, 19, 13, 16, 12, 3, 1, 53, 1, 11, 19, 15, 81, 14, 28, 7, 5, 57, 40, 40, 46, 6, 10
Offset: 2

Views

Author

Lei Zhou, Feb 15 2005

Keywords

Comments

Minimal n of sequence A103783. Weak conjecture: sequence is defined for all k>=2; strong conjecture: a(k)<=(prime(k))^2;

Examples

			P(2)*1-1=5 is prime, so a(2)=1;
P(9)*3-1=669278609 is prime, so a(9)=3;
		

Crossrefs

Programs

  • Mathematica
    nmax = 2^2048; npd = 2; n = 2; npd = npd*Prime[n]; While[npd < nmax, tt = 1; cp = npd*tt - 1; While[(tt <= (Prime[n])^2) && (! (PrimeQ[cp])), tt = tt + 1; cp = npd*tt - 1]; If[tt >= (Prime[n])^2, cp = -cp; tn1 = -tt, tn1 = tt]; Print[tn1]; n = n + 1; npd = npd*Prime[n]]

A177064 Primorial indices j such that P(j)#*2^k - 1 is a lower twin prime for the minimal k selected in A103782.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 9, 30, 96, 148, 171, 201, 246, 274, 294, 467, 543, 603, 614
Offset: 1

Views

Author

Pierre CAMI, Dec 09 2010

Keywords

Comments

For each j, the sequence A103782 constructs a prime of the form P(j)#*2^k - 1. If this is also a lower twin prime, then j is a term of this sequence.

Examples

			P(0)# = 1, P(0)#*2^2 - 1 = 3, P(0)#*2^2 + 1 = 5 twin prime of 5 so a(1)=0;
P(1)# = 1*2, P(1)#*2^1 - 1 = 3, P(1)#*2^1 + 1 = 5 twin prime of 5 so a(2)=1;
P(2)# = 1*2*3, P(2)#*2^1 - 1 = 11, P(2)#*2^1 + 1 = 13 twin prime of 11 so a(3)=2.
		

Crossrefs

Programs

  • Maple
    isA001359 := proc(n) isprime(n) and isprime(n+2) ; end proc:
    A002110 := proc(n) mul(ithprime(i),i=1..n) ; end proc:
    A103782 := proc(n) local m ; for m from 0 do if isprime(A002110(n)*2^m-1) then return m; end if; end do: end proc:
    isA177064 := proc(n) A002110(n)*2^A103782(n)-1 ; isA001359(%) ; end proc:
    for n from 0 do if isA177064(n) then print(n) ; end if; end do: # R. J. Mathar, Dec 12 2010

Formula

{j: A002110(j)*2^A103782(j)-1 in A001359}.
Showing 1-4 of 4 results.