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-3 of 3 results.

A064432 Least k such that k*10^n-9, k*10^n-7, k*10^n-3 and k*10^n-1 are all prime.

Original entry on oeis.org

14, 2, 2, 248, 1856, 7190, 719, 15308, 13415, 18434, 13532, 26975, 6935, 61763, 17786, 60140, 6014, 297974, 103199, 56321, 80009, 428186, 303476, 32558, 1361063, 444275, 634451, 116573, 303593, 293822, 1068491, 651464, 1855937, 3217754, 364985, 569129
Offset: 0

Views

Author

Don Reble, Oct 17 2001

Keywords

Examples

			a(1) = 2 because 19, 17, 13 and 11 are all prime.
		

Crossrefs

Cf. A064281.

Programs

  • Mathematica
    Do[k = 1; While[ !PrimeQ[k*10^n - 1] || !PrimeQ[k*10^n - 3] || !PrimeQ[k*10^n - 7] || !PrimeQ[k*10^n - 9], k++ ]; Print[k], {n, 0, 35} ] (* Robert G. Wilson v *)

A121066 Least positive k such that 10^n + {k, k+2, k+6, k+8} are all prime.

Original entry on oeis.org

4, 1, 1, 481, 3001, 1111, 2341, 13951, 5461, 25261, 57421, 7531, 123691, 56581, 945721, 67441, 1346491, 325231, 430711, 2139271, 2561161, 81721, 4319041, 571381, 4331251, 1232251, 7114471, 3185011, 407581, 1500631, 1846021, 1346611
Offset: 0

Views

Author

Jason Earls, Aug 10 2006

Keywords

Comments

For n >= 1, k == 1 (mod 30). - Robert Israel, May 06 2015

Crossrefs

Cf. A064281.

Programs

  • Maple
    A[0]:= 4:
    for n from 1 to 30 do
      for k from 1 by 30 do
         if andmap(isprime, map(`+`,[0,2,6,8],10^n+k)) then
            A[n]:= k; break
         fi;
    od od:
    seq(A[n],n=0..30); # Robert Israel, May 06 2015
  • Mathematica
    lpk[n_]:=Module[{k=1,x=10^n},While[AnyTrue[x+ k+{0,2,6,8}, CompositeQ], k++];k]; Table[lpk[n],{n,0,15}] (* The program generates the first 16 terms of the sequence. *) (* Harvey P. Dale, Jun 18 2022 *)
  • PARI
    print1(4,", "); n=0; until(n==100, n++; x=1; y=0; until(y==1, if(isprime(10^n+x), if(isprime(10^n+x+2), if(isprime(10^n+x+6), if(isprime(10^n+x+8), y++, x=x+30), x=x+30), x=x+30), x=x+30); if(y==1, print1(x,", ")))) \\ Tim Johannes Ohrtmann, May 04 2015
    
  • PARI
    a(n)=if(n==0, return(4)); my(k=10^n+1); while(!isprime(k) || !isprime(k+2) || !isprime(k+6) || !isprime(k+8), k+=30); k-10^n \\ Charles R Greathouse IV, May 06 2015

A242564 Least prime p such that p*10^n+1, p*10^n+3, p*10^n+7 and p*10^n+9 are all prime.

Original entry on oeis.org

19, 1657, 13, 9001, 283, 115201, 61507, 249439, 375127, 472831, 786823, 172489, 1237, 2359033, 163063, 961981, 1442017, 457, 1208833, 4845583, 1146877, 11550193, 436831, 1911031, 581047, 4504351, 215737, 3685051, 27805381, 1343791, 82491967, 15696349, 20446423
Offset: 1

Views

Author

Derek Orr, May 17 2014

Keywords

Examples

			2*10^3+1 (2001), 2*10^3+3 (2003), 2*10^3+7 (2007) and 2*10^3+9 (2009) are not all prime.
3*10^3+1 (3001), 3*10^3+3 (3003), 3*10^3+7 (3007) and 3*10^3+9 (3009) are not all prime.
5*10^3+1 (5001), 5*10^3+3 (5003), 5*10^3+7 (5007) and 5*10^3+9 (5009) are not all prime.
7*10^3+1 (7001), 7*10^3+3 (7003), 7*10^3+7 (7007) and 7*10^3+9 (7009) are not all prime.
11*10^3+1 (11001), 11*10^3+3 (11003), 11*10^3+7 (11007) and 11*10^3+9 (11009) are not all prime.
13*10^3+1 (13001), 13*10^3+3 (13003), 13*10^3+7 (13007) and 13*10^3+9 (13009) are all prime. Thus, a(3) = 13.
		

Crossrefs

Programs

  • Mathematica
    lpp[n_]:=Module[{c=10^n,p=2},While[Not[AllTrue[p*c+{1,3,7,9},PrimeQ]], p= NextPrime[ p]];p]; Array[lpp,40] (* Harvey P. Dale, Mar 24 2018 *)
  • Python
    import sympy
    from sympy import isprime
    from sympy import prime
    def Pr(n):
      for p in range(1,10**7):
        if isprime(prime(p)*(10**n)+1) and isprime(prime(p)*(10**n)+3) and isprime(prime(p)*(10**n)+7) and isprime(prime(p)*(10**n)+9):
          return prime(p)
    n = 1
    while n < 50:
      print(Pr(n))
      n += 1
Showing 1-3 of 3 results.