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.

Previous Showing 21-29 of 29 results.

A063714 Values of r occurring in A063713.

Original entry on oeis.org

3, 3, 5, 3, 3, 5, 3, 19, 5, 3, 7, 29, 3, 5, 3, 5, 3, 43, 5, 3, 7, 3, 7, 3, 5, 3, 11, 3, 5, 5, 3, 7, 89, 7, 3, 5, 3, 3, 5, 3, 13, 113, 7, 13, 127, 5, 3, 11, 137, 139, 5, 13, 3, 7, 3, 5, 5, 3, 7, 3, 13, 5, 19, 3, 3, 31, 197, 199, 7, 13, 17, 11, 3, 5, 3, 229, 5, 3, 11, 5, 11, 3, 19, 3, 7, 3, 7
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 10 2001

Keywords

Comments

This is not a mere union of A002373 and A020483 because of the minimality property of these sequences.

Crossrefs

Programs

  • Maple
    f:= proc(n) local k;
    k:= 2;
      while k < 2*n do
       k:= nextprime(k);
        if isprime(2*n+k) and isprime(2*n-k) then return k fi
      od;
      NULL
    end proc:
    map(f, [$1..400]); # Robert Israel, Oct 09 2017
  • Mathematica
    f[n_] := {AnyTrue[Prime[Range[PrimePi[2n-2]]], (r = #; PrimeQ[2n+r] && PrimeQ[2n-r])&], r}; Select[f /@ Range[200], #[[1]] =!= False &][[All, 2]] (* Jean-François Alcover, Feb 14 2018 *)

A127018 Least s with s, t both semiprime and s+2n = t.

Original entry on oeis.org

4, 6, 4, 6, 4, 9, 21, 6, 4, 6, 4, 9, 9, 6, 4, 6, 4, 10, 39, 6, 4, 14, 9, 9, 15, 6, 4, 6, 4, 9, 15, 10, 21, 6, 4, 10, 21, 6, 4, 6, 4, 9, 9, 6, 4, 14, 21, 10, 21, 6, 4, 14, 9, 10, 9, 6, 4, 6, 4, 9, 21, 9, 15, 6, 4, 9, 9, 6, 4, 6, 4, 14, 9, 10, 9, 6, 4, 10, 25, 6, 4, 14, 21, 9, 15, 6, 4, 9, 9, 14, 21, 10
Offset: 1

Views

Author

Rick L. Shepherd, Jan 02 2007

Keywords

Crossrefs

Programs

  • Mathematica
    sp=Select[Range[1000],PrimeOmega[#]==2&];seq={};Do[s=0;Until[PrimeOmega[sp[[s]]+2n]==2,s++];AppendTo[seq,sp[[s]]],{n,92}];seq (* James C. McMahon, Dec 30 2024 *)
  • PARI
    a(n) = for (k=1, oo, if ((bigomega(k)==2) && bigomega(2*n+k)==2, return(k))); \\ Michel Marcus, Dec 30 2024

A235649 Define a(4)=3 then a(n+1)is the smallest prime P such that a(n)<=P< n with 2*n-P=Q prime and if not possible a(n+1) is the smallest prime P such that P

Original entry on oeis.org

3, 3, 5, 3, 3, 5, 7, 3, 5, 7, 11, 11, 13, 3, 5, 7, 11, 11, 13, 17, 17, 19, 23, 23, 3, 5, 7, 19, 23, 23, 31, 3, 5, 7, 17, 17, 19, 23, 23, 3, 5, 7, 13, 23, 23, 31, 41, 41, 43, 47, 47, 3, 3, 5, 7, 11, 11, 13, 17, 17, 19, 23, 23, 31, 47, 59, 61, 3, 5, 7, 11
Offset: 4

Views

Author

Pierre CAMI, Jan 13 2014

Keywords

Examples

			a(4)=3 as 2*4-3=5 prime by definition
a(5)=3 as 2*5-3=7 prime, a(5)=a(4), a(5)<5
a(6)=5 as 2*6-5=7 prime, a(6)>a(5), a(6)<6
a(7)=5 not possible as 14-5=9 composite
a(7)=7 not possible as 7=7
a(7)=3 as 2*7-3=11 prime
a(8)=3 as 2*8-3=13 prime
		

Crossrefs

A290838 a(n) = smallest prime p such that 2p - 2n + 1 is prime.

Original entry on oeis.org

2, 2, 3, 5, 5, 7, 7, 13, 11, 11, 11, 13, 13, 19, 17, 17, 17, 19, 19, 37, 23, 23, 23, 29, 29, 31, 29, 29, 29, 31, 31, 37, 37, 41, 37, 37, 37, 43, 41, 41, 41, 43, 43, 61, 47, 47, 47, 53, 53, 67, 53, 53, 53, 59, 59, 61, 59, 59, 59, 61, 61, 67, 67, 71, 67, 67, 67, 73
Offset: 0

Views

Author

XU Pingya, Aug 11 2017

Keywords

Comments

a(n) > n. - Iain Fox, Nov 13 2017

Crossrefs

Programs

  • Mathematica
    Table[j=0; found=False; While[!found,j++; found=PrimeQ[2Prime[j]-2n+1] && 2Prime[j]-2n+1>0]; Prime[j],{n,67}]
    (* Second program: *)
    Table[SelectFirst[Prime@ Range[n^2], And[# > 0, PrimeQ@ #] &[2 # - 2 n + 1] &], {n, 67}] (* Michael De Vlieger, Aug 14 2017 *)
  • PARI
    a(n) = {my(p=2); while(!isprime(2*p-2*n+1), p = nextprime(p+1)); p; } \\ Michel Marcus, Aug 12 2017
    
  • PARI
    a(n) = forprime(p=n+1, , if(isprime(2*p - 2*n + 1), return(p))) \\ Iain Fox, Nov 13 2017

Formula

a(-n) = A290839(n+1) - Iain Fox, Dec 14 2017

Extensions

a(0) prepended by Iain Fox, Dec 14 2017

A290839 a(n) = smallest prime p such that 2p + 2n - 1 is prime.

Original entry on oeis.org

2, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 5, 3, 2, 2, 7, 3, 2, 3, 2, 2, 3, 2, 7, 3, 2, 5, 3, 2, 2, 7, 3, 2, 3, 2, 2, 13, 3, 2, 3, 2, 11, 3, 2, 5, 7, 3, 2, 3, 2, 2, 3, 2, 2, 3, 2, 13, 7, 11, 5, 19, 3, 2, 3, 2, 5, 3, 2, 2, 7, 5, 5, 3, 2, 2, 7, 3, 2, 13, 3, 2, 3, 2, 7, 3, 2
Offset: 0

Views

Author

XU Pingya, Aug 12 2017

Keywords

Crossrefs

Cf. A067076 (indices n at which a(n) = 2).

Programs

  • Mathematica
    Table[j=0; found=False; While[!found, j++; found=PrimeQ[2Prime[j]+2n-1]]; Prime[j], {n, 85}]
  • PARI
    a(n) = {my(p=2); while(!isprime(2*p+2*n-1), p = nextprime(p+1)); p;} \\ Michel Marcus, Aug 12 2017

Formula

a(-n) = A290838(n+1). - Iain Fox, Dec 14 2017

Extensions

a(0) prepended by Iain Fox, Dec 14 2017

A235859 Define a(4)=3, then a(n+1) is the smallest prime P such that a(n) <= P < 2*n with 2*n-P=Q prime and, if not possible, a(n+1) is the smallest prime P such that P < a(n) < 2*n with 2*n-P=Q prime.

Original entry on oeis.org

3, 3, 5, 11, 11, 11, 13, 17, 17, 19, 23, 23, 29, 29, 29, 31, 37, 37, 37, 41, 41, 43, 47, 47, 53, 53, 53, 59, 59, 59, 61, 67, 67, 67, 71, 71, 73, 79, 79, 79, 83, 83, 89, 89, 89, 19, 29, 29, 31, 47, 47, 67, 71, 71, 73, 89, 89, 103, 107, 107, 109, 113, 113
Offset: 4

Views

Author

Pierre CAMI, Jan 16 2014

Keywords

Examples

			a(4)=3 as 2*4-3=5 prime by definition
a(5)=3 as 2*5-3=7 prime, a(5)=a(4), a(5)<5
a(6)=5 as 2*6-5=7 prime, a(6)>a(5), a(6)<6
a(7)=5 not possible as 14-5=9 composite
a(7)=7 not possible as 7=7
a(7)=11 as 2*7-11=3 prime
.........................
a(48)=89 as 2*48-89=7 prime
a(49)=89 not possible as 2*49-89=9 composite
a(49)=97 not possible as 2*49-97=unity
a(49)=19 as 19 is the smallest prime such that 2*49-19 is prime
a(50)=29 as 29 is the smallest prime >=19 such that 2*50-29 is prime
		

Crossrefs

A333779 Positive numbers m used to build entire prime set by m +/- n without duplication or 0 if there is no such m.

Original entry on oeis.org

2, 4, 9, 16, 27, 42, 23, 60, 51, 70, 93, 120, 85, 114, 153, 56, 165, 174, 155, 132, 213, 218, 201, 234, 253, 288, 225, 254, 135, 360, 323, 342, 315, 274, 303, 384, 395, 420, 405, 440, 357, 420, 481, 534, 465, 454
Offset: 0

Views

Author

Marcin Barylski, Apr 05 2020

Keywords

Comments

Conjecture: every prime is eventually constructed by the sequence.
Taking into account first 10 terms: a(0),a(1),...a(9) = [2, 4, 9, 16, 27, 42, 23, 60, 51, 70] it is possible to build the following primes: [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 43, 47, 53, 59, 61, 67, 79], the only not covered (yet) primes <= 79 are: [41, 71, 73]. 73 will be covered by a(12)=85 (73=85-12), and both 41 and 71 by a(15)=56 (41=56-15, 71=56+15).
The truth of Polignac's conjecture would imply that all terms are well defined. - Rémy Sigrist, Apr 26 2020
a(n) > 0 for 1 <= n <= 10^6. - David A. Corneth, Jun 06 2020

Examples

			a(0)=2, because 2=2+0=2-0 and 2 is prime.
a(1)=4, because 3=4-1, 5=4+1, both 3 and 5 are primes, not covered yet.
a(1) is not 3 because 3+1=4 is not a prime number.
a(2)=9, because 7=9-2, 11=9+2, both 7 and 11 are primes, not covered yet.
a(2) is not 5 (although 5-2=3 and 5+2=7, both are primes) because 3 is already covered by a term a(1) - this sequence is without duplication.
		

Crossrefs

Programs

  • Mathematica
    Nest[Function[{t, i}, Append[t, Block[{k = 2, s}, While[! AllTrue[Set[s, k + i {-1, 1}], And[PrimeQ@ #, FreeQ[t[[All, -1]], #] ] &], k++]; {k, s}] ]] @@ {#, Length@ #} &, {{2, {2}}}, 60][[All, 1]] (* Michael De Vlieger, May 03 2020 *)
  • PARI
    { p=2; pp=[]; for (n=0,  45, for (k=1, oo, while (#pppp[#pp], pp = concat(pp, p); p = nextprime(p+1);); if (setsearch(pp, pp[k]+2*n), print1 (pp[k]+n", "); pp = setminus(pp, Set([pp[k], pp[k]+2*n])); break))) } \\ Rémy Sigrist, Jun 06 2020

Extensions

More terms from Michael De Vlieger, May 03 2020

A381041 Smallest prime p such that 3^n + p + 1 is prime.

Original entry on oeis.org

3, 3, 3, 3, 7, 7, 3, 19, 7, 3, 3, 19, 79, 7, 7, 43, 67, 139, 127, 103, 7, 97, 3, 31, 31, 13, 379, 61, 109, 433, 3, 79, 127, 79, 67, 139, 127, 229, 7, 109, 271, 313, 3, 151, 7, 103, 67, 283, 421, 67, 43, 373, 97, 97, 97, 19, 61, 3, 157, 331, 127, 37, 139, 439, 421
Offset: 0

Views

Author

James S. DeArmon, Apr 20 2025

Keywords

Examples

			a(0) = 3, since 3 + (3^0+1) = 5 is prime and 2 + (3^0+1) = 4 is not.
a(1) = 3, since 3 + (3^1+1) = 7 is prime and 2 + (3^1+1) = 6 is not.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local t,p;
     p:= 1: t:= 3^n+1;
     do
       p:= nextprime(p);
       if isprime(p+t) then return p fi
     od;
    end proc:
    map(f, [$0..100]); # Robert Israel, Jun 19 2025
  • Mathematica
    a[n_]:=Module[{p=2},While[!PrimeQ[p+3^n+1], p=NextPrime[p]]; p]; Array[a,65,0] (* Stefano Spezia, Apr 25 2025 *)
  • PARI
    a(n) = my(p=2, x=3^n+1); while (!isprime(p+x), p=nextprime(p+1)); p; \\ Michel Marcus, Apr 24 2025
  • Python
    from sympy import isprime, nextprime
    def a(n):
        p, b = 2, 3**n+1
        while not isprime(p+b):
            p = nextprime(p)
        return p
    print([a(n) for n in range(65)]) # Michael S. Branicky, Apr 23 2025
    
  • Python
    from sympy import nextprime, isprime
    def A381041(n):
        p = 3**n+1
        q = nextprime(p)
        while not isprime(q-p):
            q = nextprime(q)
        return q-p # Chai Wah Wu, May 01 2025
    

Formula

a(n) = A020483(A007051(n)). - Robert Israel, Jun 19 2025

Extensions

More terms from Michael S. Branicky, Apr 23 2025

A309392 Square array read by downward antidiagonals: A(n, k) is the k-th prime p such that p + 2*n is also prime, or 0 if that prime does not exist.

Original entry on oeis.org

3, 5, 3, 11, 7, 5, 17, 13, 7, 3, 29, 19, 11, 5, 3, 41, 37, 13, 11, 7, 5, 59, 43, 17, 23, 13, 7, 3, 71, 67, 23, 29, 19, 11, 5, 3, 101, 79, 31, 53, 31, 17, 17, 7, 5, 107, 97, 37, 59, 37, 19, 23, 13, 11, 3, 137, 103, 41, 71, 43, 29, 29, 31, 13, 11, 7, 149, 109
Offset: 1

Views

Author

Felix Fröhlich, Jul 28 2019

Keywords

Comments

The same as A231608 except that A231608 gives the upward antidiagonals of the array, while this sequence gives the downward antidiagonals.
Conjecture: All values are nonzero, i.e., for any even integer e there are infinitely many primes p such that p + e is also prime.
The conjecture is true if Polignac's conjecture is true.

Examples

			The array starts as follows:
3,  5, 11, 17, 29, 41, 59,  71, 101, 107, 137, 149, 179, 191
3,  7, 13, 19, 37, 43, 67,  79,  97, 103, 109, 127, 163, 193
5,  7, 11, 13, 17, 23, 31,  37,  41,  47,  53,  61,  67,  73
3,  5, 11, 23, 29, 53, 59,  71,  89, 101, 131, 149, 173, 191
3,  7, 13, 19, 31, 37, 43,  61,  73,  79,  97, 103, 127, 139
5,  7, 11, 17, 19, 29, 31,  41,  47,  59,  61,  67,  71,  89
3,  5, 17, 23, 29, 47, 53,  59,  83,  89, 113, 137, 149, 167
3,  7, 13, 31, 37, 43, 67,  73,  97, 151, 157, 163, 181, 211
5, 11, 13, 19, 23, 29, 41,  43,  53,  61,  71,  79,  83,  89
3, 11, 17, 23, 41, 47, 53,  59,  83,  89, 107, 131, 137, 173
7, 19, 31, 37, 61, 67, 79, 109, 127, 151, 157, 211, 229, 241
5,  7, 13, 17, 19, 23, 29,  37,  43,  47,  59,  73,  79,  83
		

Crossrefs

Cf. A231608.
Cf. A001359 (row 1), A023200 (row 2), A023201 (row 3), A023202 (row 4), A023203 (row 5), A046133 (row 6), A153417 (row 7), A049488 (row 8), A153418 (row 9), A153419 (row 10), A242476 (row 11), A033560 (row 12), A252089 (row 13), A252090 (row 14), A049481 (row 15), A049489 (row 16), A252091 (row 17), A156104 (row 18), A271347 (row 19), A271981 (row 20), A271982 (row 21), A272176 (row 22), A062284 (row 25), A049490 (row 32), A020483 (column 1).

Programs

  • PARI
    row(n, terms) = my(i=0); forprime(p=1, , if(i>=terms, break); if(ispseudoprime(p+2*n), print1(p, ", "); i++))
    array(rows, cols) = for(x=1, rows, row(x, cols); print(""))
    array(12, 14) \\ Print initial 12 rows and 14 columns of the array
Previous Showing 21-29 of 29 results.