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.

A085063 a(n) is the minimal number k such that n+k and n*k+1 are primes.

Original entry on oeis.org

1, 1, 2, 1, 2, 1, 4, 5, 2, 1, 2, 1, 4, 3, 2, 1, 6, 1, 10, 3, 2, 1, 6, 13, 4, 3, 4, 1, 2, 1, 10, 11, 10, 3, 2, 1, 4, 5, 2, 1, 2, 1, 4, 9, 14, 1, 6, 5, 4, 3, 2, 1, 14, 5, 6, 5, 4, 1, 12, 1, 6, 5, 10, 3, 2, 1, 4, 15, 2, 1, 8, 1, 6, 27, 8, 3, 6, 1, 4, 3, 2, 1, 6, 5, 12, 11, 20, 1, 12, 7, 6, 5, 4, 3, 2, 1, 4, 5
Offset: 1

Views

Author

Amarnath Murthy, Jun 28 2003

Keywords

Comments

If n+1 is prime then a(n)=1; if n+1 is not prime then a(n)=A120223(n).

Examples

			a(3)=2 because 3+2=5 and 3*2+1=7 are prime;
a(8)=5 because 8+5=13 and 8*5+1=41 are prime,
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local k;
    for k from 1+(n mod 2) by 2 do
      if isprime(n+k) and isprime(n*k+1) then return k fi
    od
    end proc:
    f(1):= 1: # Robert Israel, May 14 2018
  • Mathematica
    Reap[Do[Do[If[PrimeQ[{n+x, n*x+1}]=={True,True},Sow[x];Break[]],{x,1,100}],{n,120}]][[2,1]]
    nkp[n_]:=Module[{k=1},While[!And@@PrimeQ[{n+k,n*k+1}],k++];k]; Array[nkp, 100] (* Harvey P. Dale, Apr 11 2012 *)
  • PARI
    a(n) = {my(k=1); while (!isprime(n+k) || !isprime(n*k+1), k++); k;} \\ Michel Marcus, May 14 2018

Extensions

Corrected and extended by Zak Seidov, Jun 10 2006

A120223 a(n) is the minimal number k>1 such that n+k and n*k+1 are primes.

Original entry on oeis.org

2, 3, 2, 3, 2, 5, 4, 5, 2, 3, 2, 5, 4, 3, 2, 7, 6, 11, 10, 3, 2, 9, 6, 13, 4, 3, 4, 15, 2, 7, 10, 11, 10, 3, 2, 5, 4, 5, 2, 7, 2, 5, 4, 9, 14, 13, 6, 5, 4, 3, 2, 21, 14, 5, 6, 5, 4, 9, 12, 7, 6, 5, 10, 3, 2, 5, 4, 15, 2, 3, 8, 25, 6, 27, 8, 3, 6, 11, 4, 3, 2, 15, 6, 5, 12, 11, 20, 15, 12, 7, 6, 5, 4, 3
Offset: 1

Views

Author

Zak Seidov, Jun 10 2006

Keywords

Comments

If n+1 is prime then a(n)>A085063(n); if n+1 is not prime then a(n)=A085063(n).

Examples

			a(3)=2 because 3+2=5 and 3*2+1=7 are prime;
a(8)=5 because 8+5=13 and 8*5+1=41 are prime.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local k;
      for k from `if`( n::odd,2,3) do
         if isprime(n*k+1) and isprime(n+k) then return k fi
      od
    end proc:
    map(f, [$1..100]); # Robert Israel, Feb 03 2019
  • Mathematica
    Reap[Do[Do[If[PrimeQ[{n+x, n*x+1}]=={True,True},Sow[x];Break[]],{x,2,100}],{n,120}]][[2,1]]
    mnk[n_]:=Module[{k=2},While[!AllTrue[{n+k,n*k+1},PrimeQ],k++];k]; Array[ mnk,100] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Oct 15 2014 *)
  • PARI
    for(n=1,100,k=2;while(!isprime(n+k),k++;while(!isprime(n*k+1),k++));print1(k,", ")) \\ Jinyuan Wang, Feb 04 2019

A120225 a(n) is the minimal number k>n such that n+k and n*k+1 are primes.

Original entry on oeis.org

2, 3, 4, 7, 6, 7, 10, 9, 14, 13, 18, 19, 24, 15, 16, 21, 24, 29, 22, 21, 22, 31, 30, 43, 28, 33, 34, 39, 32, 41, 36, 39, 34, 37, 66, 43, 60, 41, 50, 43, 42, 55, 46, 53, 52, 51, 50, 59, 52, 51, 56, 55, 56, 55, 58, 75, 74, 69, 68, 67, 66, 75, 74, 67, 86, 83, 70, 89, 70, 79, 102, 79
Offset: 1

Views

Author

Zak Seidov, Jun 10 2006

Keywords

Comments

Differs from A120224 in the first term.

Examples

			a(3)=4 because 3+4=7 and 3*4+1=13 are prime;
a(8)=9 because 8+9=17 and 8*9+1=73 are prime,
		

Crossrefs

Programs

  • Mathematica
    Reap[Do[Do[If[PrimeQ[{n+x, n*x+1}]=={True,True},Sow[x];Break[]],{x, n+1,1000}],{n,120}]][[2,1]]
    mnk[n_]:=Module[{k=n+1},While[!AllTrue[{n+k,n*k+1},PrimeQ],k++];k]; Array[ mnk,80] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, May 15 2015 *)

A120226 Numbers k such that 4+k and 4*k+1 are prime.

Original entry on oeis.org

1, 3, 7, 9, 13, 15, 25, 27, 37, 39, 43, 49, 57, 67, 69, 79, 93, 97, 99, 105, 127, 135, 153, 163, 169, 175, 177, 189, 193, 207, 219, 235, 253, 265, 267, 273, 277, 279, 303, 307, 309, 343, 345, 363, 405, 417, 427, 435, 475, 483, 487, 499, 517, 553, 559, 567, 573
Offset: 1

Views

Author

Zak Seidov, Jun 10 2006

Keywords

Comments

Except for 3, no terms == 3 or 5 (mod 7). - Robert Israel, Jul 26 2019

Crossrefs

Programs

  • Maple
    select(t -> isprime(t+4) and isprime(4*t+1), [seq(i,i=1..1000,2)]); # Robert Israel, Jul 26 2019
  • Mathematica
    Select[Range[600],AllTrue[{4+#,4#+1},PrimeQ]&] (* Harvey P. Dale, Nov 14 2022 *)

A120227 Numbers k such that 5+k and 5*k+1 are prime.

Original entry on oeis.org

2, 6, 8, 12, 14, 26, 36, 38, 42, 48, 54, 56, 62, 66, 84, 92, 98, 104, 108, 126, 132, 152, 162, 176, 188, 194, 206, 218, 234, 236, 246, 258, 264, 272, 276, 302, 306, 344, 348, 362, 374, 416, 426, 428, 444, 456, 462, 474, 482, 504, 518, 542, 558, 572, 594, 602
Offset: 1

Views

Author

Zak Seidov, Jun 10 2006

Keywords

Comments

This sequence is infinite under Dickson's conjecture. - Charles R Greathouse IV, Apr 16 2012

Crossrefs

Programs

  • Mathematica
    Select[Range[700],And@@PrimeQ[{#+5,5#+1}]&] (* Harvey P. Dale, Dec 18 2011 *)
Showing 1-5 of 5 results.