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.

Previous Showing 11-20 of 58 results. Next

A073175 First occurrence of an n-digit prime as a substring in the concatenation of the natural numbers 12345678910111213141516171819202122232425262728293031....

Original entry on oeis.org

2, 23, 101, 4567, 67891, 789101, 4567891, 23456789, 728293031, 1234567891, 45678910111, 678910111213, 1222324252627, 12345678910111, 415161718192021, 3637383940414243, 12223242526272829, 910111213141516171
Offset: 1

Views

Author

Zak Seidov, Aug 22 2002

Keywords

Comments

This is to Champernowne's constant 0.12345678910111213... (Sloane's A033307) as A073062 is to A033308 Decimal expansion of Copeland-Erdos constant: concatenate primes. - Jonathan Vos Post, Aug 25 2008

Examples

			Take 1234567891011121314151617....; a(4)=4567 because the first 4-digit prime in the sequence is 4567.
1213 is < 4567 but occurs later in the string.
a(5) = 67891 is the first occurrence of a five-digit substring that is a prime, 12345(67891)011121314...
a(1) = 2 = prime(1). a(2) = 23 = prime(9). a(3) = 571 = prime(105). a(4) = 2357 = prime(350). a(5) = 11131 = prime(1349). - _Jonathan Vos Post_, Aug 25 2008
		

Crossrefs

Cf. A003617. - M. F. Hasler, Aug 23 2008

Programs

  • Maple
    N:= 1000: # to use the concatenation of 1 to N
    L:= NULL:
    for n from 1 to N do
      L:= L, op(ListTools:-Reverse(convert(n,base,10)))
    od:
    L:= [L]:
    nL:= nops(L);
    f:= proc(n) local k,B,x;
      for k from 1 to nL-n+1 do
        B:= L[k..k+n-1];
        x:= add(B[i]*10^(n-i),i=1..n);
        if isprime(x) then return x fi
      od;
    false;
    end proc:
    seq(f(n),n=1..100); # Robert Israel, Aug 16 2018
  • Mathematica
    p200=Flatten[IntegerDigits[Range[200]]]; Do[pn=Partition[p200, n, 1]; ln=Length[pn]; tab=Table[Sum[10^(n-k)*pn[[i, k]], {k, n}], {i, ln}]; Print[{n, Select[tab, PrimeQ][[1]]}], {n, 20}]
  • PARI
    {s=Vec(Str(c=1)); for(d=1,30, for(j=1,9e9,
    #sM. F. Hasler, Aug 23 2008

Extensions

Edited by N. J. A. Sloane, Aug 19 2008 at the suggestion of R. J. Mathar

A131581 The next prime greater than the square root of 10^n.

Original entry on oeis.org

2, 5, 11, 37, 101, 317, 1009, 3163, 10007, 31627, 100003, 316241, 1000003, 3162283, 10000019, 31622777, 100000007, 316227767, 1000000007, 3162277669, 10000000019, 31622776621, 100000000003, 316227766069, 1000000000039
Offset: 0

Views

Author

Robert G. Wilson v, Jan 12 2007

Keywords

Comments

The difference between a(n) and floor(sqrt(10^n)): 1, 2, 1, 6, 1, 1, 9, 1, 7, 5, 3, 14, 3, 6, 19, 1, 7, 1, 7, 9, ....
Values for which the difference between a(n) and floor(sqrt(10^n)) equals one: 0, 2, 4, 5, 7, 15, 17, 25, 145, 1079, ..., (1350). Only even terms are 0, 2 & 4; all the rest must be odd.

Crossrefs

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; Table[ NextPrim@ Floor@ Sqrt[10^n], {n, 0, 25}]
    Table[NextPrime[Sqrt[10^n]],{n,0,30}] (* Harvey P. Dale, Aug 15 2017 *)

Formula

a(n) = sqrt(A175733(n+1)). [From Jaroslav Krizek, Aug 24 2010]

A098449 Smallest n-digit semiprime.

Original entry on oeis.org

4, 10, 106, 1003, 10001, 100001, 1000001, 10000001, 100000001, 1000000006, 10000000003, 100000000007, 1000000000007, 10000000000015, 100000000000013, 1000000000000003, 10000000000000003, 100000000000000015, 1000000000000000007, 10000000000000000001
Offset: 1

Views

Author

Rick L. Shepherd, Sep 07 2004

Keywords

Crossrefs

Cf. A098450 (largest n-digit semiprime), A003617 (smallest n-digit prime), A001358 (semiprimes).

Programs

  • Mathematica
    NextSemiPrime[n_, k_: 1] := Block[{c = 0, sgn = Sign[k]}, sp = n + sgn; While[c < Abs[k], While[ PrimeOmega[sp] != 2, If[sgn < 0, sp--, sp++]]; If[sgn < 0, sp--, sp++]; c++]; sp + If[sgn < 0, 1, -1]]; f[n_] := NextSemiPrime[10^n - 1]; Array[f, 19, 0] (* Robert G. Wilson v, Dec 18 2012 *)
    Table[Module[{k=0},While[PrimeOmega[10^n+k]!=2,k++];10^n+k],{n,0,20}] (* Harvey P. Dale, Jun 15 2025 *)
  • PARI
    a(n)=for(k=10^(n-1),10^n-1,if(bigomega(k)==2,return(k)))
    vector(50, n, a(n)) \\ Derek Orr, Aug 15 2014
    
  • Python
    from sympy import factorint
    def semiprime(n): f = factorint(n); return sum(f[p] for p in f) == 2
    def a(n):
      an = max(1, 10**(n-1))
      while not semiprime(an): an += 1
      return an
    print([a(n) for n in range(1, 21)]) # Michael S. Branicky, Apr 10 2021

A064490 Smallest prime with prime(n) decimal digits.

Original entry on oeis.org

11, 101, 10007, 1000003, 10000000019, 1000000000039, 10000000000000061, 1000000000000000003, 10000000000000000000009, 10000000000000000000000000331, 1000000000000000000000000000057, 1000000000000000000000000000000000067, 10000000000000000000000000000000000000121
Offset: 1

Views

Author

Jason Earls, Oct 04 2001

Keywords

Examples

			11 is the first prime with 2 decimal digits.
101 is the first prime with 3 decimal digits.
		

Crossrefs

Programs

  • Maple
    for n from 1 to 20 do p := ithprime(n): for i from 10^(p-1) to 10^p do if isprime(i) then printf(`%d,`,i); break; fi: od: od:
    # second Maple program:
    a:= n-> nextprime(10^(ithprime(n)-1)):
    seq(a(n), n=1..15);  # Alois P. Heinz, Jun 24 2018
  • Mathematica
    Table[NextPrime[10^(n-1)],{n,Prime[Range[15]]}] (* Harvey P. Dale, Feb 06 2020 *)
  • PARI
    l(n)=ln=0; while(n,n=floor(n/10); ln++); return(ln);
    a=0; for(n=1,10^6,x=l(prime(n)); if(isprime(x),b=x; if(b>a,a=b; print(prime(n)))))
    
  • PARI
    { for (n=1, 75, p=prime(n); a=nextprime(10^(p - 1)); write("b064490.txt", n, " ", a) ) } \\ Harry J. Smith, Sep 16 2009
    
  • Python
    from sympy import prime, nextprime, primepi
    def a(n): return nextprime(10**(prime(n)-1))
    print([a(n) for n in range(1, 14)]) # Michael S. Branicky, May 26 2021

Formula

a(n) = A003617(A000040(n)).
a(n) = A000040(A064489(n)).

Extensions

More terms from James Sellers, Oct 08 2001
Offset changed from 0 to 1 by Harry J. Smith, Sep 16 2009

A069100 n-th n-digit prime number.

Original entry on oeis.org

2, 13, 107, 1021, 10061, 100069, 1000117, 10000189, 100000193, 1000000181, 10000000259, 100000000193, 1000000000303, 10000000000411, 100000000000487, 1000000000000513, 10000000000000931, 100000000000000591, 1000000000000000861, 10000000000000000667
Offset: 1

Views

Author

Darrell Minor, Apr 05 2002

Keywords

Crossrefs

Programs

Extensions

More terms from Vladeta Jovovic, Apr 07 2002
Extended by Eduard Roure Perdices, May 17 2021

A090226 Least k such that prime(k) has n digits. Index of least n-digit prime.

Original entry on oeis.org

1, 5, 26, 169, 1230, 9593, 78499, 664580, 5761456, 50847535, 455052512, 4118054814, 37607912019, 346065536840, 3204941750803, 29844570422670, 279238341033926, 2623557157654234, 24739954287740861, 234057667276344608, 2220819602560918841, 21127269486018731929
Offset: 1

Views

Author

Amarnath Murthy, Nov 25 2003

Keywords

Crossrefs

Cf. A003617 (values of prime(k)), A006880.

Programs

  • Mathematica
    Table[PrimePi[NextPrime[10^n]],{n,0,14}] (* This generates the first 15 terms of the sequence, but Mathematica cannot generate the 16th term using this program. *) (* Harvey P. Dale, May 12 2019 *)

Formula

a(1)=1; a(n) = pi(10^(n-1)) + 1 for n > 1 where pi(x) is the number of primes less than x. - C. Ronaldo (aga_new_ac(AT)hotmail.com), Dec 26 2004
a(n) = A006880(n-1) + 1, for n >= 1. - Eduard Roure Perdices, Apr 18 2021

Extensions

Corrected and extended by C. Ronaldo (aga_new_ac(AT)hotmail.com), Dec 26 2004
Extended by Eduard Roure Perdices, Apr 18 2021

A139053 Array read by rows: row n lists the first 3 primes with n digits.

Original entry on oeis.org

2, 3, 5, 11, 13, 17, 101, 103, 107, 1009, 1013, 1019, 10007, 10009, 10037, 100003, 100019, 100043, 1000003, 1000033, 1000037, 10000019, 10000079, 10000103, 100000007, 100000037, 100000039, 1000000007, 1000000009, 1000000021, 10000000019, 10000000033, 10000000061
Offset: 1

Views

Author

Omar E. Pol, Apr 08 2008

Keywords

Crossrefs

Programs

  • Mathematica
    np[n_]:=Module[{a=NextPrime[10^n]},{a,NextPrime[a], NextPrime[NextPrime[ a]]}]; Flatten[Array[np,12,0]] (* Harvey P. Dale, Dec 14 2011 *)
    Flatten@Array[NextPrime[10^#,{1,2,3}]&,12,0] (* Giorgos Kalogeropoulos, May 06 2019 *)
  • Python
    from sympy import nextprime
    def auptodigs(maxdigits):
      alst = []
      for n in range(1, maxdigits+1):
        p1 = nextprime(10**(n-1))
        p2 = nextprime(p1)
        p3 = nextprime(p2)
        alst.extend([p1, p2, p3])
      return alst
    print(auptodigs(11)) # Michael S. Branicky, May 07 2021

Extensions

More terms from Max Alekseyev, Dec 12 2011
a(32) and beyond from Michael S. Branicky, May 07 2021

A139054 Array read by rows: row n lists the first 4 primes with n digits.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 101, 103, 107, 109, 1009, 1013, 1019, 1021, 10007, 10009, 10037, 10039, 100003, 100019, 100043, 100049, 1000003, 1000033, 1000037, 1000039, 10000019, 10000079, 10000103, 10000121, 100000007, 100000037, 100000039, 100000049
Offset: 1

Views

Author

Omar E. Pol, Apr 08 2008

Keywords

Comments

First differs from A000040 at a(9). - Omar E. Pol, Feb 13 2014

Examples

			Array begins:
    2,   3,   5,   7;
   11,  13,  17,  19;
  101, 103, 107, 109;
  ...
		

Crossrefs

Programs

  • Mathematica
    Flatten @ Table[ NextPrime[10^i, Range @ 4], {i, 0, 9}] (* Mikk Heidemaa, Jan 08 2023 *)

Formula

a(4n-3) = A003617(n). - Omar E. Pol, Feb 13 2014

Extensions

More terms from Michel Marcus, Feb 13 2014

A180922 Smallest n-digit number that is divisible by exactly 3 primes (counted with multiplicity).

Original entry on oeis.org

8, 12, 102, 1001, 10002, 100006, 1000002, 10000005, 100000006, 1000000003, 10000000001, 100000000006, 1000000000001, 10000000000001, 100000000000018, 1000000000000002, 10000000000000006, 100000000000000007, 1000000000000000001, 10000000000000000007
Offset: 1

Views

Author

Jonathan Vos Post, Jan 23 2011

Keywords

Comments

This is to 3 as smallest n-digit semiprime A098449 is to 2, and as smallest n-digit prime A003617 is to 1. Smallest n-digit triprime. Smallest n-digit 3-almost prime.

Examples

			a(1) = 8 because 8=2^3 is the smallest (only) 1-digit number divisible by exactly 3 primes (counted with multiplicity).
a(2) = 12 because 12 = 2^2 * 3 is the smallest of the (21) 2-digit numbers divisible by exactly 3 primes (counted with multiplicity).
a(3) = 102 because 102 = 2 * 3 * 17 is the smallest 3-digit numbers divisible by exactly 3 primes (counted with multiplicity).
		

Crossrefs

Programs

  • PARI
    A180922(n)=for(n=10^(n-1),10^n-1,bigomega(n)==3&return(n)) \\ M. F. Hasler, Jan 23 2011
    
  • Python
    from sympy import factorint
    def triprimes(n): f = factorint(n); return sum(f[p] for p in f) == 3
    def a(n):
      an = max(1, 10**(n-1))
      while not triprimes(an): an += 1
      return an
    print([a(n) for n in range(1, 21)]) # Michael S. Branicky, Apr 10 2021

A249447 Least n-digit prime whose digit sum is also prime.

Original entry on oeis.org

2, 11, 101, 1013, 10037, 100019, 1000033, 10000019, 100000037, 1000000033, 10000000019, 100000000019, 1000000000039, 10000000000037, 100000000000031, 1000000000000037, 10000000000000079, 100000000000000013, 1000000000000000031, 10000000000000000051, 100000000000000000039
Offset: 1

Views

Author

Paolo P. Lava, Oct 29 2014

Keywords

Comments

Subsequence of A046704 (primes with digits sum being prime).
Some terms of this sequence are also in A003617, the least n-digit primes. - Michel Marcus, Oct 30 2014

Examples

			a(1) = 2 because it is the least prime with just one digit.
a(2) = 11 because it is the least prime with 2 digits whose sum, 1 + 1 = 2, is a prime.
Again, a(7) = 1000033 because it is the least prime with 7 digits whose sum is a prime: 1 + 0 + 0 + 0 + 0 + 3 + 3 = 7.
		

Crossrefs

Programs

  • Maple
    P:=proc(q) local a,b,k,n; for k from 0 to q do
    for n from 10^k to 10^(k+1)-1 do if isprime(n) then a:=n; b:=0;
    while a>0 do b:=b+(a mod 10); a:=trunc(a/10); od;
    if isprime(b) then print(n); break; fi; fi;
    od; od; end: P(10^3);
  • PARI
    a(n) = {p = nextprime(10^(n-1)); while (!isprime(sumdigits(p)), p = nextprime(p+1)); p;} \\ Michel Marcus, Oct 29 2014
Previous Showing 11-20 of 58 results. Next