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-10 of 13 results. Next

A016014 Least k such that 2*n*k + 1 is a prime.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 3, 2, 1, 1, 3, 3, 1, 5, 1, 1, 2, 1, 2, 2, 1, 2, 2, 1, 1, 5, 3, 1, 2, 1, 1, 2, 3, 1, 3, 1, 4, 2, 1, 2, 3, 3, 1, 2, 1, 1, 3, 1, 1, 3, 1, 2, 2, 6, 2, 3, 3, 1, 2, 1, 3, 2, 1, 1, 2, 4, 3, 2, 1, 1, 3, 3, 1, 2, 4, 1, 5, 1, 2, 6, 1, 2, 2, 1, 1, 3, 7, 2, 5, 1, 1, 2, 1, 1
Offset: 1

Views

Author

Keywords

Comments

Is the sequence bounded? - Zak Seidov, Mar 25 2014
Answer: No, for any given N a number n such that a(n) > N can be constructed by the Chinese Remainder Theorem, see A239727. - Charles R Greathouse IV, Mar 25 2014
a(n) = 1 for n in A005097. - Robert Israel, Oct 26 2016

Crossrefs

A070846 contains the corresponding primes.
Records are in A239746 with indices in A239727.

Programs

  • Maple
    f:= proc(n) local k;
         for k from 1 do if isprime(2*n*k+1) then return k fi od
    end proc:
    map(f, [$1..100]); # Robert Israel, Oct 26 2016
  • Mathematica
    Do[k = 1; cp = n*k + 1; While[ ! PrimeQ[cp], k++; cp = n*k + 1]; Print[k], {n, 2, 400, 2}] (* Lei Zhou, Feb 23 2005 *)
    lk[n_]:=Module[{k=1},While[!PrimeQ[2n k+1],k++];k]; Array[lk,100] (* Harvey P. Dale, Apr 23 2023 *)
  • PARI
    a(n)=my(k); while(!isprime(2*n*(k++)+1),);k \\ Charles R Greathouse IV, Mar 25 2014
    
  • Python
    from sympy import isprime
    def a(n):
        k = 1
        while not isprime(2*n*k + 1): k += 1
        return k
    print([a(n) for n in range(1, 100)]) # Michael S. Branicky, Mar 28 2022

A070853 Smallest prime == 1 mod (9n).

Original entry on oeis.org

19, 19, 109, 37, 181, 109, 127, 73, 163, 181, 199, 109, 937, 127, 271, 433, 307, 163, 2053, 181, 379, 199, 829, 433, 1801, 937, 487, 757, 523, 271, 1117, 577, 1783, 307, 631, 1297, 1999, 2053, 3511, 1801, 739, 379, 1549, 397, 811, 829, 1693, 433, 883
Offset: 1

Views

Author

Amarnath Murthy, May 15 2002

Keywords

Crossrefs

Programs

  • PARI
    for(n=1,80,s=1; while((isprime(s)*s-1)%(9*n)>0,s++); print1(s,","))

Extensions

Corrected and extended by Benoit Cloitre, May 18 2002

A070850 Smallest prime == 1 mod (6n).

Original entry on oeis.org

7, 13, 19, 73, 31, 37, 43, 97, 109, 61, 67, 73, 79, 337, 181, 97, 103, 109, 229, 241, 127, 397, 139, 433, 151, 157, 163, 337, 349, 181, 373, 193, 199, 409, 211, 433, 223, 229, 937, 241, 739, 757, 1033, 1321, 271, 277, 283, 577, 883, 601, 307, 313, 3181, 1297
Offset: 1

Views

Author

Amarnath Murthy, May 15 2002

Keywords

Crossrefs

Programs

  • PARI
    for(n=1,80,s=1; while((isprime(s)*s-1)%(6*n)>0,s++); print1(s,","))

Extensions

More terms from Benoit Cloitre, May 18 2002

A070851 Smallest prime == 1 mod (7n).

Original entry on oeis.org

29, 29, 43, 29, 71, 43, 197, 113, 127, 71, 463, 337, 547, 197, 211, 113, 239, 127, 1597, 281, 883, 463, 967, 337, 701, 547, 379, 197, 2437, 211, 1303, 449, 463, 239, 491, 757, 2591, 1597, 547, 281, 1723, 883, 3011, 617, 631, 967, 659, 337, 1373, 701, 1429
Offset: 1

Views

Author

Amarnath Murthy, May 15 2002

Keywords

Crossrefs

Programs

  • Mathematica
    Module[{nn=60,prs=Prime[Range[500]]},Table[SelectFirst[prs,Mod[#,7n]==1&],{n,nn}]] (* Harvey P. Dale, Apr 13 2022 *)
  • PARI
    for(n=1,80,s=1; while((isprime(s)*s-1)%(7*n)>0,s++); print1(s,","))

Extensions

More terms from Benoit Cloitre, May 18 2002

A070852 Smallest prime == 1 mod (8n).

Original entry on oeis.org

17, 17, 73, 97, 41, 97, 113, 193, 73, 241, 89, 97, 313, 113, 241, 257, 137, 433, 457, 641, 337, 353, 1289, 193, 401, 1249, 433, 449, 233, 241, 1489, 257, 1321, 1361, 281, 577, 593, 1217, 313, 641, 2297, 337, 1033, 353, 1801, 3313, 1129, 769, 3137, 401
Offset: 1

Views

Author

Amarnath Murthy, May 15 2002

Keywords

Crossrefs

Cf. A070846 to A070851 and A070853.
Cf. A034694.

Programs

  • PARI
    for(n=1,80,s=1; while((isprime(s)*s-1)%(8*n)>0,s++); print1(s,","))

Extensions

More terms from Benoit Cloitre, May 18 2002

A070847 Smallest prime == 1 mod (3n).

Original entry on oeis.org

7, 7, 19, 13, 31, 19, 43, 73, 109, 31, 67, 37, 79, 43, 181, 97, 103, 109, 229, 61, 127, 67, 139, 73, 151, 79, 163, 337, 349, 181, 373, 97, 199, 103, 211, 109, 223, 229, 937, 241, 739, 127, 1033, 397, 271, 139, 283, 433, 883, 151, 307, 157, 3181, 163, 331, 337
Offset: 1

Views

Author

Amarnath Murthy, May 15 2002

Keywords

Crossrefs

Cf. A034694.
Cf. A024892 (n such that a(n)=3*n+1).
Cf. A002476.

Programs

  • Maple
    f:= proc(n) local k,d;
      if n::even then d:= 3*n else d:= 6*n fi;
      for k from 1 by d do if isprime(k) then return k fi od
    end proc:
    map(f, [$1..100]); # Robert Israel, Sep 19 2019
  • Mathematica
    a[n_] := Module[{k, d}, If[EvenQ[n], d = 3n, d = 6n]; For[k = 1, True, k += d, If[PrimeQ[k], Return[k]]]];
    Array[a, 100] (* Jean-François Alcover, Jun 11 2020, after Maple *)
  • PARI
    for(n=1,80,s=1; while((isprime(s)*s-1)%(3*n)>0,s++); print1(s,","))

Extensions

More terms from Benoit Cloitre, May 18 2002

A070848 Smallest prime == 1 mod (4n).

Original entry on oeis.org

5, 17, 13, 17, 41, 73, 29, 97, 37, 41, 89, 97, 53, 113, 61, 193, 137, 73, 229, 241, 337, 89, 277, 97, 101, 313, 109, 113, 233, 241, 373, 257, 397, 137, 281, 433, 149, 457, 157, 641, 821, 337, 173, 353, 181, 1289, 941, 193, 197, 401, 409, 1249, 1061, 433, 661
Offset: 1

Views

Author

Amarnath Murthy, May 15 2002

Keywords

Comments

Note interesting patterns in the graph. - Zak Seidov, Dec 13 2011

Examples

			5 is the smallest prime of the form 1+4m, 17 is the smallest prime of the form 1+8m, 13 is the smallest prime of the form 1+12m, etc. - _Zak Seidov_, Dec 13 2011
		

Crossrefs

Programs

  • Mathematica
    nn=100; Reap[Do[p=1+4n; While[!PrimeQ[p], p=p+4n]; Sow[p], {n,nn}]][[2,1]] (* Zak Seidov, Dec 13 2011 *)
  • PARI
    for(n=1,80,s=1; while((isprime(s)*s-1)%(4*n)>0,s++); print1(s,","))
    
  • PARI
    nn=10000;for(n=1,nn,s=1+4*n;while(!isprime(s),s=s+4*n);print1(s,", ")) \\ Zak Seidov, Dec 13 2011
    
  • Python
    from sympy import isprime
    def a(n):
      k = 4*n + 1
      while not isprime(k): k += 4*n
      return k
    print([a(n) for n in range(1, 56)]) # Michael S. Branicky, May 17 2021

Extensions

More terms from Benoit Cloitre, May 18 2002

A070849 Smallest prime == 1 mod (5n).

Original entry on oeis.org

11, 11, 31, 41, 101, 31, 71, 41, 181, 101, 331, 61, 131, 71, 151, 241, 1021, 181, 191, 101, 211, 331, 461, 241, 251, 131, 271, 281, 1451, 151, 311, 641, 331, 1021, 701, 181, 1481, 191, 1171, 401, 821, 211, 431, 661, 1801, 461, 941, 241, 491, 251, 1021, 521
Offset: 1

Views

Author

Amarnath Murthy, May 15 2002

Keywords

Crossrefs

Programs

  • PARI
    for(n=1,80,s=1; while((isprime(s)*s-1)%(5*n)>0,s++); print1(s,","))

Extensions

More terms from Benoit Cloitre, May 18 2002

A070854 Smallest prime == 1 mod (10^n).

Original entry on oeis.org

11, 101, 3001, 70001, 700001, 22000001, 30000001, 600000001, 6000000001, 30000000001, 1900000000001, 18000000000001, 40000000000001, 3900000000000001, 6000000000000001, 130000000000000001, 3700000000000000001, 15000000000000000001, 150000000000000000001, 600000000000000000001, 16000000000000000000001
Offset: 1

Views

Author

Amarnath Murthy, May 15 2002

Keywords

Comments

a(6) through a(21) have been certified prime with Primo. - Rick L. Shepherd, Jun 03 2002

Crossrefs

Programs

  • PARI
    a(n)=for(i=1,+oo,if(isprime(i*10^n+1), return(i*10^n+1))) \\ Johann Peters, Dec 27 2024

Formula

a(n) = A121172(n)*10^n + 1. - Ray Chandler, Feb 10 2009

Extensions

More terms from Rick L. Shepherd, Jun 03 2002

A341861 Number of primes among the (p-1)/2 numbers {2*p+1, 4*p+1, ..., (p-1)*p+1}, p = prime(n).

Original entry on oeis.org

1, 1, 2, 3, 4, 3, 2, 4, 4, 3, 4, 5, 7, 8, 5, 8, 7, 9, 9, 10, 11, 11, 12, 12, 14, 13, 13, 12, 15, 14, 14, 17, 15, 19, 18, 12, 19, 13, 19, 20, 22, 20, 24, 21, 15, 21, 21, 23, 25, 26, 23, 26, 26, 19, 23, 27, 24, 29, 27, 26, 28, 31, 29, 30, 25, 30, 30, 34, 31, 29, 35
Offset: 2

Views

Author

Jianing Song, Feb 21 2021

Keywords

Comments

By Dirichlet's theorem on arithmetic progressions, we know there exists a prime q of the form 2*k*p+1. But the theorem does not give us any information about the size of the smallest q. It is conjectured that q < p^2. Moreover, it seems that a(n) goes to infinity as n increases.

Examples

			Let P denote the set of prime numbers. Then:
a(8) = #({39, 77, 115, 153, 191, 229, 267, 305, 343} intersect P) = #{191, 229} = 2.
a(11) = #({63, 125, 187, 249, 311, 373, 435, 497, 559, 621, 683, 745, 807, 869, 931} intersect P) = #{311, 373, 683} = 3.
		

Crossrefs

Cf. A070846.

Programs

  • PARI
    a(n) = my(p=prime(n)); sum(k=1, (p-1)/2, isprime(2*k*p+1))
Showing 1-10 of 13 results. Next