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

A069841 A036937(n) - 222...2 (with n 2s) interpreted as binary numbers and converted to decimal.

Original entry on oeis.org

0, 1, 1, 7, 15, 5, 7, 1, 47, 21, 1, 61, 5, 13, 51, 41, 29, 29, 31, 19, 33, 7, 13, 31, 19, 67, 27, 93, 25, 43, 9, 49, 5, 81, 67, 1, 91, 21, 121, 81, 15, 149, 19, 161, 23, 119, 25, 107, 117, 43, 9, 117, 13, 85, 55, 131, 9, 7, 57, 17, 145, 73, 17, 301, 305, 157, 341
Offset: 1

Views

Author

Robert G. Wilson v, May 03 2002

Keywords

Comments

Values of k arising from Mathematica calculation of A036937.

Crossrefs

Cf. A036937.

Programs

  • Mathematica
    Do[p = 2(10^n - 1)/9; k = 0; While[ ! PrimeQ[p], k++; p = FromDigits[ PadLeft[ IntegerDigits[k, 2], n] + 2]]; Print[p], {n, 1, 30}]

Extensions

Definition amended by Georg Fischer, Sep 18 2023

A036229 Smallest n-digit prime containing only digits 1 or 2 or -1 if no such prime exists.

Original entry on oeis.org

2, 11, 211, 2111, 12211, 111121, 1111211, 11221211, 111112121, 1111111121, 11111121121, 111111211111, 1111111121221, 11111111112221, 111111112111121, 1111111112122111, 11111111111112121, 111111111111112111, 1111111111111111111, 11111111111111212121
Offset: 1

Views

Author

Keywords

Comments

It is conjectured that such a prime always exists.
a(2), a(19), a(23), etc. are the prime repunits (A004023). a(1000) = (10^n-1)/9 + 111011000010.

Crossrefs

Programs

  • Mathematica
    Do[p = (10^n - 1)/9; k = 0; While[ ! PrimeQ[p], k++; p = FromDigits[ PadLeft[ IntegerDigits[ k, 2], n] + 1]]; Print[p], {n, 1, 20}]
    Table[Min[Select[ FromDigits/@Tuples[{1,2},n],PrimeQ]],{n,20}] (* Harvey P. Dale, Feb 05 2014 *)
  • Python
    from sympy import isprime
    def A036229(n):
        k, r, m = (10**n-1)//9, 2**n-1, 0
        while m <= r:
            t = k+int(bin(m)[2:])
            if isprime(t):
                return t
            m += 1
        return -1 # Chai Wah Wu, Aug 18 2021

Extensions

Edited by N. J. A. Sloane and Robert G. Wilson v, May 03 2002
Escape clause added by Chai Wah Wu, Aug 18 2021

A069837 Smallest prime which is a concatenation of n primes.

Original entry on oeis.org

2, 23, 223, 2237, 22273, 222323, 2222273, 22222223, 222222227, 2222222377, 22222222223, 222222223273, 2222222222273, 22222222222327, 222222222222227, 2222222222222533, 22222222222223557, 222222222222222577, 2222222222222222327, 22222222222222222253, 222222222222222222277, 2222222222222222222273, 22222222222222222222327
Offset: 1

Views

Author

Amarnath Murthy, Apr 16 2002

Keywords

Comments

Conjecture: For every n there exists an n-digit prime which is composed of the digits 2,3,5 and 7. I.e., no prime > 7 is required in this concatenation. I.e., a(n) of A069637 contains exactly n digits. This is a weaker conjecture than the one by Patrick De Geest in A036937.
If the conjecture is true then this also gives the smallest n-digit prime with prime digits. - Amarnath Murthy, Apr 02 2003
Except for the first term, A096506 lists indices n=2,3,8,11,36,95,101,128,... for which a(n) is of the form 2...23. - M. F. Hasler, Apr 25 2008

Crossrefs

Cf. A036937.
Cf. A096506.

Programs

  • Mathematica
    f[n_] := Block[{p = 2(10^n - 1)/9}, While[ !PrimeQ[p] || Union[ PrimeQ[ IntegerDigits[p]]] != {True}, p++ ]; p]; Table[ f[n], {n, 1, 20}]
  • PARI
    A069837(n)={ local( p=(10^n-1)\9*2-1 ); n=Vec("2357"); until( !setminus( Set(Vec(Str(p))), n), p=nextprime(p+1)); p } /* a more efficient version should check digits one by one and skip to the next possible candidate (i.e., add 12...23 - p%10^d) when a nonprime digit is found */ \\ M. F. Hasler, Apr 25 2008

Extensions

Edited, corrected and extended by Robert G. Wilson v, Apr 22 2002

A069749 Number of primes less than 10^n containing only the digits 2 and 3 (A020458).

Original entry on oeis.org

2, 3, 5, 7, 11, 18, 31, 44, 83, 135, 239, 436, 818, 1436, 2773, 4695, 9244, 17022, 32948, 58158, 116040, 214188, 423902, 791950, 1554834, 2904470, 5725780, 10536383, 21070698, 40748211, 79634658, 148530950, 296094802, 561919901
Offset: 1

Views

Author

Robert G. Wilson v, Apr 22 2002

Keywords

Comments

a(22) / A006880(22) = 214188 / 201467286689315906290 =~ 10^-15. But out of the 2^22 candidates for primes, ~5% are.

Crossrefs

Programs

  • Mathematica
    s = 0; Do[k = 0; While[k < 2^n, k++; If[p = FromDigits[ PadLeft[ IntegerDigits[k, 2], n] + 2]; PrimeQ[p], s++ ]]; Print[s], {n, 1, 22}]
    With[{c=Select[Flatten[Table[FromDigits/@Tuples[{2,3},n],{n,22}]], PrimeQ]}, Table[Count[c,?(#<10^i&)],{i,22}]] (* _Harvey P. Dale, Mar 18 2016 *)
  • Python
    from sympy import isprime
    from itertools import count, islice, product
    def agen(): # generator of terms
        c = 2
        for d in count(2):
            yield c
            for first in product("23", repeat=d-1):
                t = int("".join(first) + "3")
                if isprime(t): c += 1
    print(list(islice(agen(), 20))) # Michael S. Branicky, May 23 2024

Extensions

a(23)-a(27) from Sean A. Irvine, May 17 2024
a(28)-a(34) from Michael S. Branicky, May 22 2024
Showing 1-4 of 4 results.