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.

A036012 a(n) = smallest number > 1 such that a(1)a(2)...a(n) + 1 is prime.

Original entry on oeis.org

2, 2, 3, 3, 2, 6, 3, 2, 4, 7, 7, 3, 8, 6, 2, 3, 6, 9, 6, 14, 19, 11, 4, 4, 19, 4, 13, 3, 10, 13, 15, 4, 11, 9, 2, 5, 26, 19, 52, 21, 20, 63, 4, 19, 17, 6, 29, 19, 3, 5, 51, 11, 14, 15, 7, 12, 44, 34, 7, 21, 32, 3, 22, 10, 19, 19, 7, 20, 4, 22, 4, 17, 35, 47, 40, 14, 5, 14, 36, 39, 16
Offset: 1

Views

Author

Keywords

Comments

Except for the first term, same as A084401. - David Wasserman, Dec 22 2004

Crossrefs

Equals A084716(n+1)/A084716(n).

Programs

  • Maple
    n := 1: while true do j := 2: while not isprime(j*n+1) do j := j+1: od: print(j): n := n*j: od:
  • Mathematica
    a[1] = 2; a[n_] := a[n] = Catch[For[an = 2, True, an++, If[PrimeQ[Product[a[k], {k, 1, n - 1}]*an + 1], Throw[an]]]]; Table[a[n], {n, 1, 81}] (* Jean-François Alcover, Nov 27 2012 *)
    nxt[{t_,n_}]:=Module[{k=2},While[!PrimeQ[t*k+1],k++];{t*k,k}]; NestList[ nxt,{2,2},80][[All,2]] (* Harvey P. Dale, Oct 03 2020 *)
  • Python
    from gmpy2 import is_prime
    from itertools import count, islice
    def agen(): # generator of terms
        p = 1
        while True:
            an = next(k for k in count(2) if (t:=p*k+1) == 1 or is_prime(t))
            p *= an
            yield an
    print(list(islice(agen(), 81))) # Michael S. Branicky, Jan 20 2024

Formula

Conjecture: a(n) = O(n). - Thomas Ordowski, Aug 08 2017

Extensions

More terms from Erich Friedman
More terms from Jud McCranie, Jan 26 2000
Description corrected by Len Smiley

A083769 a(1)=2; for n >= 2, a(n) = smallest even number such that a(1)*a(2)*...*a(n) + 1 is prime.

Original entry on oeis.org

2, 6, 8, 12, 16, 10, 4, 30, 26, 22, 24, 14, 50, 42, 18, 64, 46, 60, 32, 36, 20, 34, 28, 108, 48, 44, 68, 282, 90, 54, 76, 62, 180, 66, 132, 86, 74, 38, 58, 106, 120, 52, 244, 94, 100, 82, 138, 156, 98, 72, 172, 150, 248, 154, 166, 114, 162, 126, 124, 208, 222, 324, 212
Offset: 1

Views

Author

Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), May 06 2003

Keywords

Comments

Is this a permutation of the even numbers?
For any even positive integers a_1, a_2, ..., a_n, there are infinitely many even positive integers t such that a_1 a_2 ... a_n t + 1 is prime: this follows from Dirichlet's theorem on primes in arithmetic progressions. As far as I know there is no guarantee that the sequence defined here leads to a permutation of the even numbers, i.e. there might be some even integer that never appears in the sequence. However, if the partial products a_1 ... a_n grow like 2^n n!, heuristically the probability of a_1 ... a_n t + 1 being prime is on the order of 1/log(a_1 ... a_n) ~ 1/(n log n), and since sum_n 1/(n log n) diverges we might expect that there should be infinitely many n for which some a_1 ... a_n t + 1 is prime, and thus every even integer should occur. - Robert Israel, Dec 20 2012

Examples

			2+1=3, 2*6+1=13, 2*6*8+1=97, 2*6*8*12+1=1153, etc. are primes.
After 200 terms the prime is
224198929826405912196464851358435330956778558123234657623126\
069546460095464785674042966210907411841359152393200850271694\
899718487202330385432243578646330245831108247815285116235792\
875886417750289946171599027675234787802312202111702704952223\
563058999855839876391430601719636148884060097930252529666254\
756431522481046758186320659298713737639441014068272279177710\
551232067814381240340990584869121776471244800000000000000000\
00000000000000000000000000000 (449 digits). - _Robert Israel_, Dec 21 2012
		

Crossrefs

Programs

  • Maple
      N := 200: # number of terms desired
    P := 2:
    a[1] := 2:
    C := {seq(2*j, j = 2 .. 10)}:
    Cmax := 20:
    for n from 2 to N do
       for t in C do
          if isprime(t*P+1) then
            a[n]:= t;
            P:= t*P;
            C:= C minus {t};
            break;
          end if;
       end do;
       while not assigned(a[n]) do
         t0:= Cmax+2;
         Cmax:= 2*Cmax;
         C:= C union {seq(j, j=t0 .. Cmax, 2)};
         for t from t0 to Cmax by 2 do
           if isprime(t*P+1) then
             a[n]:= t;
             P:= t*P;
             C:= C minus {t};
             break;
           end if
         end do;
       end do;
    end do;
    [seq(a[n],n=1..N)];
  • Mathematica
    f[s_List] := Block[{k = 2, p = Times @@ s}, While[ MemberQ[s, k] || !PrimeQ[k*p + 1], k += 2]; Append[s, k]]; Nest[f, {2}, 62] (* Robert G. Wilson v, Dec 24 2012 *)

Extensions

More terms from David Wasserman, Nov 23 2004
Edited by N. J. A. Sloane, Dec 20 2012
Comment edited, Maple code and additional terms by Robert Israel, Dec 20 2012

A084402 n-th partial product - 1 is a prime, where a(n) > 1.

Original entry on oeis.org

3, 2, 2, 2, 2, 4, 2, 3, 6, 4, 5, 5, 5, 10, 4, 3, 5, 8, 22, 13, 14, 2, 5, 5, 2, 20, 9, 9, 24, 5, 26, 15, 14, 25, 25, 4, 9, 30, 9, 21, 12, 11, 10, 2, 40, 19, 8, 13, 11, 50, 3, 25, 25, 8, 5, 25, 46, 19, 47, 54, 9, 13, 14, 43, 4, 24, 28, 16, 33, 25, 152, 2, 11, 22, 6, 78, 87, 7, 10, 21, 77, 23
Offset: 1

Views

Author

Amarnath Murthy, May 31 2003

Keywords

Comments

a(n) exists for each n by Dirichlet's theorem. - Charles R Greathouse IV, Oct 31 2014
Same as A036013 for n > 4. - Georg Fischer, Oct 19 2018

Examples

			3-1 = 2, 3*2-1 = 5, 3*2*2 -1 = 11, etc. are primes.
		

Crossrefs

Programs

  • PARI
    lista(nn) = {v = vector(nn); for (n=1, nn, v[n] = 2; while (! isprime(prod(i=1, n, v[i])-1), v[n]++); print1(v[n], ", "););} \\ Michel Marcus, Oct 31 2014
    
  • PARI
    first(n) = my(res=vector(n), pp=1, t); for(i = 1, n, t = 2; while(!isprime(pp * t - 1), t++); pp *= t; res[i]=t); res \\ David A. Corneth, Oct 19 2018

Extensions

More terms from David Wasserman, Dec 22 2004

A058000 a(n) is smallest prime such that a(n)+1 is a proper multiple of a(n-1)+1 [with a(1)=1].

Original entry on oeis.org

1, 3, 7, 23, 47, 191, 383, 1151, 6911, 27647, 138239, 691199, 3455999, 34559999, 138239999, 414719999, 2073599999, 16588799999, 364953599999, 4744396799999, 66421555199999, 132843110399999, 664215551999999, 3321077759999999
Offset: 1

Views

Author

Henry Bottomley, Nov 02 2000

Keywords

Crossrefs

Formula

a(n)= Product{i=1_n}[A036013(i)]-1 = a(n-1)*A036013(n)-1+A036013(n).

A083275 a(n) = smallest number not occurring earlier such that a(1)*a(2)*...*a(n) - 1 is prime.

Original entry on oeis.org

3, 1, 2, 4, 7, 5, 6, 11, 12, 10, 13, 17, 14, 16, 15, 8, 18, 23, 21, 26, 22, 27, 41, 30, 20, 57, 32, 29, 24, 65, 42, 38, 28, 63, 35, 19, 58, 31, 36, 61, 45, 37, 33, 69, 53, 67, 127, 40, 95, 25, 86, 48, 39, 72, 70, 79, 54, 74, 91, 125, 85, 94, 46, 9, 80, 60, 119, 167, 139, 90, 49
Offset: 1

Views

Author

Vladeta Jovovic, Jun 01 2003

Keywords

Crossrefs

Programs

  • Maple
    b:= proc() false end:
    m:= proc(n) option remember; a(n)*m(n-1) end: m(0):=1:
    a:= proc(n) option remember; local k; for k while b(k)
          or not isprime(k*m(n-1)-1) do od; b(k):=true; k
        end:
    seq(a(n), n=1..80); # Alois P. Heinz, Jun 17 2015
  • Mathematica
    p=1; L={}; Do[k=1; While[ MemberQ[L, k] || !PrimeQ[p*k - 1], k++]; p *= k; AppendTo[L, k], {30}]; L (* Giovanni Resta, Jun 23 2015 *)
  • PARI
    v=[3];n=1;while(n<100,s=-1+n*prod(i=1,#v,v[i]);if(isprime(s)&&!vecsearch(vecsort(v),n),v=concat(v,n);n=0);n++);v \\ Derek Orr, Jun 16 2015

Extensions

Name corrected by Derek Orr, Jun 16 2015
Showing 1-5 of 5 results.