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

A121172 Smallest integer k>0 such that k*10^n + 1 is a prime.

Original entry on oeis.org

1, 1, 3, 7, 7, 22, 3, 6, 6, 3, 19, 18, 4, 39, 6, 13, 37, 15, 15, 6, 16, 9, 96, 61, 19, 6, 9, 3, 33, 63, 57, 117, 55, 49, 30, 3, 28, 6, 42, 24, 36, 72, 21, 60, 6, 24, 33, 61, 21, 85, 31, 49, 13, 93, 18, 90, 9, 16, 135, 19, 55, 9, 135, 60, 6, 30, 3, 16, 115, 114, 19, 99, 15, 147, 171, 42
Offset: 1

Views

Author

Alexander Adamchuk, Aug 14 2006

Keywords

Examples

			a(1) = 1 because A030430[1] = 11 is a smallest prime of form 10*k + 1.
a(2) = 1 because A062800[1] = 101 is a smallest prime of form 100*k + 1.
		

Crossrefs

Cf. A030430, A062800, see A070854 for resulting primes.

Programs

  • Mathematica
    s={};Do[k=0;Until[PrimeQ[k*10^n+1],k++];AppendTo[s,k],{n,76}];s (* James C. McMahon, Oct 13 2024 *)

Formula

a(n) = (A070854(n)-1)/10^n. - Ray Chandler, Feb 10 2009

Extensions

Minor edits by Ray Chandler, Feb 10 2009

A379150 Smallest prime ending in "3", with n preceding "0" digits.

Original entry on oeis.org

103, 2003, 70003, 100003, 1000003, 20000003, 500000003, 40000000003, 40000000003, 100000000003, 2000000000003, 230000000000003, 3100000000000003, 11000000000000003, 20000000000000003, 100000000000000003, 1000000000000000003, 310000000000000000003, 500000000000000000003
Offset: 1

Views

Author

James S. DeArmon, Dec 16 2024

Keywords

Comments

Leading zeros are not allowed, e.g., "03".
a(997) has 1001 digits. - Michael S. Branicky, Dec 16 2024

Examples

			a(1) = 103, is the smallest prime ending in "03";
a(2) = 2003, is the smallest prime ending in "003".
		

Crossrefs

Programs

  • Mathematica
    Table[i=1;While[!PrimeQ[m=FromDigits[Join[IntegerDigits[i],Table[0,n],{3}]]],i++];m,{n,19}] (* James C. McMahon, Dec 23 2024 *)
  • PARI
    a(n)=for(i=1, oo, if(isprime(i*10^(n+1)+3), return(i*10^(n+1)+3))) \\ Johann Peters, Dec 27 2024
  • Python
    import sympy
    def prime3_finder():
      outVec = []
      power = 2
      for n in range(100,999999999):
          if not n & 3 == 3: continue # speed-up over simple MOD operation
          if not n % 10**power == 3: continue
          if not sympy.isprime(n): continue
          outVec.append(n)
          power += 1
      return outVec
    outvec = prime3_finder()
    print(outvec)
    
  • Python
    from sympy import isprime
    from itertools import count
    def a(n): return next(i for i in count(10**(n+1)+3, 10**(n+1)) if isprime(i))
    print([a(n) for n in range(1, 20)]) # Michael S. Branicky, Dec 16 2024
    

Extensions

More terms from Michael S. Branicky, Dec 16 2024
Showing 1-2 of 2 results.