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-9 of 9 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

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

Original entry on oeis.org

1, 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 A120225 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,1000}],{n,120}]][[2,1]]
    mnk[n_]:=Module[{k=n},Until[AllTrue[{n+k,n*k+1},PrimeQ],k++];k]; Join[{1},Array[mnk,80,2]] (* Harvey P. Dale, May 12 2025 *)

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 *)

A092944 Group the natural numbers so that the n-th group contains n numbers whose sum as well as the group product + 1 is prime. Sequence contains the first member of the groups.

Original entry on oeis.org

2, 1, 3, 5, 11, 15, 20, 27, 36, 44, 54, 64, 76, 89, 102, 117, 132, 149, 166, 184, 204, 228, 249, 272, 296, 323, 349, 376, 403, 432, 461, 493, 524, 556, 589, 625, 660, 697, 737, 775, 814, 855, 898, 943, 987, 1031, 1076, 1122, 1169, 1219, 1269, 1321, 1373, 1427
Offset: 1

Views

Author

Amarnath Murthy, Mar 23 2004

Keywords

Comments

The n-th group is chosen so that it is lexicographically earliest.
First n-2 numbers are the least previously unused numbers.
The (n-1)st number is chosen with the additional condition that if the product is odd, the sum is also odd (to avoid an impossible situation in picking the n-th number).
The n-th number is chosen as the least unused number that meets the two prime conditions.
In the 3rd group, 6 is selected as the 2nd number rather than 5, else no 3rd number could be found to meet the prime conditions.

Examples

			Table begins:
2
1,4
3,6,10
5,7,8,9
11,12,13,14,23
15,16,17,18,19,28
		

Crossrefs

Extensions

Edited and extended by Ray Chandler, May 07 2008

A092946 Group the natural numbers so that the n-th group contains n numbers whose sum as well as the group product +1 is prime. Sequence contains the primes arising as the sum of the terms of groups.

Original entry on oeis.org

2, 5, 19, 29, 73, 113, 167, 269, 431, 509, 673, 977, 1193, 1423, 1861, 1993, 2467, 3041, 3391, 4003, 4523, 5309, 6011, 6833, 7993, 9239, 10093, 10909, 12157, 13417, 15199, 16651, 17971, 19477, 21517, 23197, 25121, 27799, 29537, 31891, 34583, 37189
Offset: 1

Views

Author

Amarnath Murthy, Mar 23 2004

Keywords

Comments

See A092944 for additional clarification of definition.

Crossrefs

Extensions

Edited and extended by Ray Chandler, May 07 2008

A092947 Group the natural numbers so that the n-th group contains n numbers whose sum as well as the group product +1 is prime. Sequence contains the primes arising as the product of the terms of groups +1.

Original entry on oeis.org

3, 5, 181, 2521, 552553, 39070081, 4180176001, 1483048828801, 672375473078401, 106890247271808001, 40812700642879334401, 37716399337002946560001, 18266163370859189769984001, 9553876078552184850831360001
Offset: 1

Views

Author

Amarnath Murthy, Mar 23 2004

Keywords

Comments

See A092944 for additional clarification of definition.

Crossrefs

Extensions

Edited, corrected and extended by Ray Chandler, May 07 2008
Showing 1-9 of 9 results.