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

A037056 a(n)-th prime is the smallest prime containing exactly n 2's.

Original entry on oeis.org

2, 1, 48, 331, 2490, 94500, 1283805, 1402294, 12238270, 891573671, 975688072, 77612456753, 715763987889, 748327378591, 6944174236934, 580400102242316, 5209104353769836, 5710407472211223, 510579443617388387, 4806424039483242581, 45763276831811185976, 440594267900327752100
Offset: 0

Views

Author

Patrick De Geest, Jan 04 1999

Keywords

Crossrefs

Programs

  • Mathematica
    (* see A037057 for f *) PrimePi[ Table[ f[n, 2], {n, 1, 13}]]

Formula

a(n) = A000720(A037057(n)). - Amiram Eldar, Jul 20 2025

Extensions

a(0)=2 prepended by Sean A. Irvine, Dec 06 2020
a(14)-a(21) calculated using Kim Walisch's primecount and added by Amiram Eldar, Jul 20 2025

A065585 Smallest prime beginning with exactly n 2's.

Original entry on oeis.org

3, 2, 223, 2221, 22229, 2222203, 22222253, 22222223, 222222227, 22222222273, 22222222223, 2222222222243, 22222222222201, 22222222222229, 222222222222227, 222222222222222043, 222222222222222281, 222222222222222221, 22222222222222222253, 222222222222222222277
Offset: 0

Views

Author

Robert G. Wilson v, Nov 28 2001

Keywords

Crossrefs

A068103 is a lower bound, but most often equality holds. - M. F. Hasler, Oct 17 2012

Programs

  • Mathematica
    Do[a = Table[2, {n}]; k = 0; While[b = FromDigits[ Join[a, IntegerDigits[k] ]]; First[ IntegerDigits[k]] == 2 || !PrimeQ[b], k++ ]; Print[b], {n, 1, 17} ]
  • PARI
    A065585(n)={n=10^n\9*2; n>2&for(d=1, 9e9, n*=10; for(t=1, 10^d-1, t\10^(d-1)==2 & t+= 10^(d-1)+(t>2); ispseudoprime(n+t) & return(n+t))); 2+!n} \\ M. F. Hasler, Oct 17 2012
    
  • Python
    from sympy import isprime
    def a(n):
      if n < 2: return list([3, 2])[n]
      n2s, i, pow10, end_digits = int('2'*n), 1, 1, 0
      while True:
        i = 1
        while i < pow10:
          istr = str(i)
          if istr[0] == '2' and len(istr) == end_digits:
            i += pow10 // 10
          else:
            t = n2s * pow10 + i
            if isprime(t): return t
            i += 2
        pow10 *= 10; end_digits += 1
    print([a(n) for n in range(20)]) # Michael S. Branicky, Mar 02 2021

Extensions

Corrected by Don Reble, Jan 17 2007

A176096 Smallest prime p = p(n) containing exactly n strings "13" (n = 1, 2, ...).

Original entry on oeis.org

13, 13313, 1313813, 131313113, 13131313133, 1131313131313, 131313131313139, 13131313131313913, 1313131311313131313, 113131313131313131313, 13131313131313133131313, 1313131131313131313131313
Offset: 1

Views

Author

Eva-Maria Zschorn (e-m.zschorn(AT)zaschendorf.km3.de), Apr 08 2010

Keywords

Examples

			n = 1: prime(6) = 13 is 1st term of sequence
prime(12268) = 131303 > 21313 = prime(2392) > 13313 = prime(1581) = p(2), 2nd term of sequence
prime(857198) = 13131317 > 4131313 = prime(291796) > prime(102949) = 1341313 > 1313813 = prime() = p(3), 3rd term of sequence
n = 13: 131131313131313131313131313 a 27-digit prime is 13th term of sequence
		

References

  • E. I. Ignatjew, Mathematische Spielereien, Urania Verlag Leipzig/Jena/Berlin 1982
  • B. A. Kordemski: Koepfchen, Koepfchen! Mathematik zur Unterhaltung, Urania Verlag Leipzig/Jena/Berlin 1965

Crossrefs

A178000 Largest n-digit prime with the maximum number of digits equal to 2.

Original entry on oeis.org

2, 29, 229, 2221, 22229, 922223, 9222229, 22222223, 222222227, 7222222229, 22222222223, 522222222229, 9222222222229, 22222222222229, 222222222222227, 9222222222222227, 72222222222222221, 222222222222222221
Offset: 1

Views

Author

Lekraj Beedassy, May 17 2010

Keywords

Comments

Select first for most 2's, then take the largest.
In more detail: To get a(n), look at the list of all the n-digit primes. Suppose k is the maximum number of 2's of any number on the list. Throw out any prime on the list that does not contain k 2's. Then a(n) = maximal number that is left on the list. - N. J. A. Sloane, Mar 20 2018
For n <= 1000, a(n) has at most two non-2's. What is the first n for which it has more than two? - Robert Israel, Mar 20 2018

Crossrefs

Programs

  • Maple
    # This program will return FAIL if a(n) has more than two digits <> 2.
    f:= proc(n)
       local k1,d2,k2,t;
       for k1 in [9,7,3,1] do if isprime(2/9*(10^n-1)+k1-2) then return 2/9*(10^n-1)+k1-2 fi od;
       for d2 from n to 2 by -1 do
         for k2 in [9,8,7,6,5,4,3] do
           for k1 in [9,7,3,1] do
             t:= 2/9*(10^(n)-1)+(k2-2)*10^(d2-1) + k1-2;
             if isprime(t) then return t fi;
      od od od:
      FAIL
    end proc:
    f(1):= 2:
    seq(f(n),n=1..30); # Robert Israel, Mar 20 2018

A375760 Array read by rows: T(n,k) is the first prime with exactly n occurrences of decimal digit k.

Original entry on oeis.org

2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 101, 13, 2, 3, 41, 5, 61, 7, 83, 19, 1009, 11, 223, 233, 443, 557, 661, 277, 881, 199, 10007, 1117, 2221, 2333, 4441, 5557, 6661, 1777, 8887, 1999, 100003, 10111, 22229, 23333, 44449, 155557, 166667, 47777, 88883, 49999, 1000003, 101111, 1222229, 313333, 444443, 555557, 666667, 727777, 888887, 199999
Offset: 0

Views

Author

Robert Israel, Aug 27 2024

Keywords

Examples

			T(4,1) = 10111 because 10111 is the first prime with four 1's.
Array starts
      2      2       3      2      2      2      2      2      2      2
    101     13       2      3     41      5     61      7     83     19
   1009     11     223    233    443    557    661    277    881    199
  10007   1117    2221   2333   4441   5557   6661   1777   8887   1999
 100003  10111   22229  23333  44449 155557 166667  47777  88883  49999
1000003 101111 1222229 313333 444443 555557 666667 727777 888887 199999
		

Crossrefs

Programs

  • Maple
    F:= proc(v,x) local d,y,z,L,S,SS,Cands,t,i,k;
       for d from v do
         Cands:= NULL;
         if x = 0 then SS:= combinat:-choose([$2..d-1],v)
         elif member(x,[1,3,7,9]) then SS:= combinat:-choose(d,v)
         else SS:= combinat:-choose([$2..d],v)
         fi;
         for S in SS do
           for y from 9^(d-v+1) to 9^(d-v+1)+9^(d-v)-1 do
             L:= convert(y,base,9)[1..d-v+1];
             L:= map(proc(s) if s < x then s else s+1 fi end proc, L);
             i:= 1;
             t:= 0:
             for k from 1 to d do
               if member(k,S) then t:= t + x*10^(k-1)
               else t:= t + L[i]*10^(k-1); i:= i+1;
               fi;
             od;
             Cands:= Cands, t
         od od;
         Cands:= sort([Cands]);
         for t in Cands do if isprime(t) then return t fi od;
       od
    end proc:
    F(0,0):= 2: F(1,2):= 2: F(1,5):= 5:
    for i from 0 to 10 do
      seq(F(i,x), x=0..9)
    od;
  • Mathematica
    T[n_,k_]:=Module[{p=2},While[Count[IntegerDigits[p],k]!=n, p=NextPrime[p]]; p]; Table[T[n,k],{n,0,5},{k,0,9}]//Flatten (* Stefano Spezia, Aug 27 2024 *)

A176009 Smallest prime p = p(k) containing all decimal digits from "1" up to "k" (k = 1,2, ..., 9, 0).

Original entry on oeis.org

11, 211, 1123, 1423, 112543, 1124653, 1234657, 112345687, 1123468597, 10123457689
Offset: 1

Views

Author

Eva-Maria Zschorn (e-m.zschorn(AT)zaschendorf.km3.de), Apr 06 2010

Keywords

Comments

List of prime indices of these ten p(k):
5, 47, 188, 224, 10665, 87496, 95365, 6429837, 56789283, 460412186

Examples

			k = 1: 11 = prime(5), 1st term
k = 2: 21 is composite, 211 = prime(47), 2nd term
k = 3, digits 1,2 and 3: as 1+2+3 = 3 * 2 prime p(3) has d > 3 digits:
prime(216) = 1321 > 1231 = prime(202) > 1123 = prime(188), 3rd term
k = 4: 1423 = prime(224), k = 5: 112543 = prime(10665)
k = 6 = 2 * 3: 1124653 = prime(87496)
k = 7: p(7) = 1234657 = prime(95365) = prime(n)
Curious as sod(p(7)) = 1+2+3+4+6+5+7 = 28 = 9+5+3+6+5 = sod(95365) = sod(n),
7th term p(7) is a so-called Honaker prime
k = 8: 112345687 = prime(6429837)
k = 9 = 3 * 3: 1123468597 = prime(56789283)
All ten decimal digits: 10123457689 = prime(460412186)
		

Crossrefs

Previous Showing 11-16 of 16 results.