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.

A157712 Smallest prime made up of 0's and prime(n) 1's (or 0 when no such prime exists).

Original entry on oeis.org

11, 0, 101111, 11110111, 101111111111, 101101111111111, 101111111111111111, 1111111111111111111, 11111111111111111111111, 111110111111111111111111111111, 11111101111111111111111111111111
Offset: 1

Views

Author

Lekraj Beedassy, Mar 04 2009

Keywords

Comments

Smallest prime with digit sum A000040(n) and using only 0's and 1's. Subsequence of A157709.

Crossrefs

Cf. A054750.

Programs

  • Python
    from _future_ import division
    from itertools import combinations
    from sympy import prime, isprime
    def A157712(n):
        if n == 1:
            return 11
        if n == 2:
            return 0
        p = prime(n)
        l = p
        while True:
            for i in combinations(range(l),l-p):
                s = ['1']*l
                for x in i:
                    s[x] = '0'
                q = int(''.join(s))
                if isprime(q):
                    return q
            l += 1 # Chai Wah Wu, Nov 05 2015

Extensions

Extended by Ray Chandler, Mar 06 2009

A261173 Table read by antidiagonals: T(n,k) = smallest prime p containing only digits 0 and 1 with n 0's and k 1's, or 0 if no such p exists.

Original entry on oeis.org

11, 0, 101, 0, 0, 0, 0, 10111, 0, 0, 0, 101111, 0, 0, 0, 0, 0, 0, 1011001, 0, 0, 0, 11110111, 0, 10011101, 10010101, 0, 0, 0, 101111111, 101101111, 0, 100100111, 101001001, 0, 0, 0, 0, 1010111111, 1001110111, 0, 1000011011, 1000001011, 0, 0
Offset: 0

Views

Author

Felix Fröhlich, Aug 10 2015

Keywords

Comments

T(n, k) = 0 if k is a term of A008585.
T(0, k) != 0 iff k is a term of A004023.
T(1, k) = A157709(k-2) for all k >= 4.
T(n, 2) != 0 iff A062397(n+1) is prime.
a(n) is in A168586 iff it is the smallest p in T with A007953(p) = k.

Examples

			Table T(n, k) starts
     k = 2        3        4        5
      -------------------------------------
n = 0 |  11       0        0        0
n = 1 |  101      0        10111    101111
n = 2 |  0        0        0        0
n = 3 |  0        0        1011001  10011101
		

Crossrefs

Programs

  • PARI
    a(n, k) = i=0; forprime(p=10^(n+k-1), (10^(n+k)-1)/9, if(vecmax(digits(p))==1 && sumdigits(p)==k, return(p); i++; break)); if(i==0, return(0))
    table(row, col) = for(x=0, row, for(y=2, col, print1(a(x, y), " ")); print(""))
    table(4, 5) \\ print 5 X 4 table

Extensions

More terms from Alois P. Heinz, Aug 17 2015
Showing 1-2 of 2 results.