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

A069691 Smallest prime with internal digits = n; or 0 if no such number exists.

Original entry on oeis.org

101, 113, 127, 131, 149, 151, 163, 173, 181, 191, 1103, 1117, 1123, 2131, 2141, 1151, 1163, 1171, 1181, 1193, 1201, 1213, 1223, 1231, 1249, 1259, 2267, 1277, 1283, 1291, 1301, 1319, 1321, 2333, 2341, 2351, 1361, 1373, 1381, 1399, 1409, 2411, 1423, 1433, 1447
Offset: 0

Views

Author

Amarnath Murthy, Apr 06 2002

Keywords

Comments

By placing one digit on both sides of n one get 36 different numbers that might be primes ( 1 to 9 on left and 1,3,7,9 on right). If none of these numbers is a prime then a(n) = 0.
The smallest value of n for which a(n) = 0 is 2437 = A032734(0). - Rick L. Shepherd and Reinhard Zumkeller, Jul 17 2002

Examples

			a(25) = 1259 is prime with internal digits =25.
		

Crossrefs

Extensions

Corrected and extended by Larry Reeves, Rick L. Shepherd and Reinhard Zumkeller, Jul 17 2002

A084413 Smallest prime with "n" as central digit(s), or -1 if no such prime exists.

Original entry on oeis.org

101, 113, 2, 3, 149, 5, 163, 7, 181, 191, 1103, 11, 1123, 13, 2141, 1151, 1163, 17, 1181, 19, 1201, 1213, 1223, 23, 1249, 1259, 2267, 1277, 1283, 29, 1301, 31, 1321, 2333, 2341, 2351, 1361, 37, 1381, 1399, 1409, 41, 1423, 43, 1447, 1451, 2467, 47, 1481
Offset: 0

Views

Author

Zak Seidov, Jun 24 2003

Keywords

Comments

For n=5620 and n=7358, adding only one digit to both sides do not result in any prime. - Robert Price, Sep 16 2023

Examples

			a(1)=113 because 113 is the smallest prime with "1" as central digit.
a(10)=1103 because 1103 is the smallest prime with "10" as central digits.
		

Crossrefs

Programs

  • PARI
    findex(n) = {for (i = 1, 9, forstep (j=1, 9, 2, v = j + 10*n + i*10^(1+length(Str(n))); if (isprime(v), return (v));););}
    a(n) = if (isprime(n), n, findex(n)); \\ code assumes only 1 digit on each side of 'n' will be necessary. See A032734 for numbers that need a better script. - Michel Marcus, Oct 05 2013

Formula

If n is prime, then a(n) = n, else a(n) = A069691(n). - Michel Marcus, Oct 05 2013

Extensions

Escape clause added by N. J. A. Sloane, Nov 11 2020

A172514 First prime not the middle of a prime two digits longer in base n.

Original entry on oeis.org

3, 7, 19, 97, 823, 3499, 2777, 6827, 2437, 21523, 300299, 446273, 339769, 1168523, 14117417, 29227421, 14160061, 78521987, 161187707, 1200085823, 2125209127, 1369430897, 56378083771, 26054006611, 76375900241, 290373503549, 640442460709
Offset: 2

Views

Author

James G. Merickel, Feb 05 2010

Keywords

Examples

			In base n=10, 2437 is the least prime such that all numbers of the form x2437y where x and y are digits [1..9] are composite, so a(10)=2437.
		

Crossrefs

Cf. A032734 (in base 10 and not limited to primes).

Programs

  • PARI
    isok(p, n) = my(m=logint(p,n)+1); for (x=1, n-1, my(q = x*n^m+p); for (y=1, n-1, if (isprime(n*q+y), return (0)););); return(1);
    a(n) = my(p=2); while (!isok(p, n), p=nextprime(p+1)); p; \\ Michel Marcus, Sep 04 2022
    
  • Python
    from sympy import isprime, nextprime
    def digits(n, b):
        c = 0
        while n >= b: n //= b; c += 1
        return c + 1
    def a(n):
        p = 2
        while True:
            d, p1, found = digits(p, n), n*p, True
            for f in range(n**(d+1), n**(d+2), n**(d+1)):
                for e in range(0, n, 2) if (f+p1)%2 else range(1, n, 2):
                    if isprime(f + p1 + e): found = False; break
                if not found: break
            if found: return p
            p = nextprime(p)
    print([a(n) for n in range(2, 15)]) # Michael S. Branicky, Sep 05 2022

Extensions

a(24)-a(26) added by James G. Merickel, Sep 22 2014
a(26) removed (see user talk page) by Bill McEachen, Sep 03 2022
a(26) from Michael S. Branicky, Sep 20 2022
a(27) from Michael S. Branicky, Jul 10 2023
a(28) from Michael S. Branicky, Jul 12 2023

A181333 a(n) cannot be prefixed or followed by any digit to form a semiprime.

Original entry on oeis.org

60, 208, 252, 552, 588, 630, 656, 696, 710, 768, 816, 864, 1025, 1028, 1050, 1225, 1280, 1300, 1432, 1804, 1950, 2004, 2016, 2152, 2160, 2376, 2410, 2664, 2672, 2808, 2920, 2988, 3172, 3230, 3356
Offset: 1

Views

Author

Jonathan Vos Post, Jan 27 2011

Keywords

Comments

Analogy: semiprimes A001358 are to primes A000040 as this sequence is to A032734.

Examples

			a(1) = 60 because 60 (any digit to the left still gives a multiple of 10, not a semiprime) and
601 is prime,
602 = 2 * 7 * 43,
603 = 3^2 * 67,
604 = 2^2 * 151,
605 = 5 * 11^2,
606 = 2 * 3 * 101,
607 is prime,
608 = 2^5 * 19,
609 = 3 * 7 * 29.
a(2) = 208 because any digit to the left still ends in 8, and is nonsemiprime, and:
2081 is prime,
2082 = 2 * 3 * 347,
2083 is prime,
2084 = 2^2 * 521,
2085 = 3 * 5 * 139,
2086 = 2 * 7 * 149,
2087 is prime,
2088 = 2^3 *  3^2 * 29,
2089 is prime.
		

Crossrefs

Cf. A001358.

Programs

  • Maple
    filter:= proc(n) local i,r; r:= 10^(1+ilog10(n)); not ormap(t -> numtheory:-bigomega(t)=2, [seq(i*r+n, i=1..9),seq(10*n+i,i=0..9)]) end proc:
    select(filter, [$1..10000]); # Robert Israel, Feb 02 2025
  • Mathematica
    fQ[n_] := Block[{d = Range[0, 9], id = IntegerDigits@ n}, Union[ semiPrimeQ@ # & /@ Sort@ Join[ FromDigits /@ (Join[{#}, id] & /@ d), FromDigits /@ (Join[id, {#}] & /@ d)]] == {False}];
    Select [ Range@ 100, fQ] ; (* Robert G. Wilson v, Jan 27 2011 *)

A181739 Smallest semiprime with internal digits = n; or 0 if no such number exists.

Original entry on oeis.org

106, 111, 121, 133, 141, 155, 161, 177, 183, 194, 1101, 1111, 1121, 1133, 1141, 1154, 1165, 1174, 1186, 1191, 1202, 1211, 1226, 1234, 1241, 1253, 1261, 1271, 1282, 1293, 1306, 1313, 1322, 1333, 1343, 1351, 1363, 1371, 1382, 1391, 1401, 1411, 2426
Offset: 0

Views

Author

Jonathan Vos Post, Jan 31 2011

Keywords

Comments

This is to A069691 as semiprimes A001358 are to primes A000040.
By placing one digit on both sides of n (1..9 on the left and on the right) one gets 81 different numbers that might be semiprimes. If none of these numbers is a semiprime then a(n) = 0.
The smallest n such that a(n) = 0 is 20056492. - Donovan Johnson, Feb 01 2011
If one or more digits are allowed on both sides of n, the smallest semiprime containing 20056492 is 10200564926 = 2*5100282463.

Examples

			a(23) = 1234 = 2 * 617 has the embedded substring 1"23"4.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) local i, j, k;
          for i to 9 do
            for j to 9 do
              k:= parse(cat(i, n, j));
              if not isprime(k) and add(t[2], t=ifactors(k)[2])=2
                 then return k fi
            od
          od; return 0;
        end:
    seq(a(n), n=0..60);  # Alois P. Heinz, Feb 01 2011

Extensions

More terms from Alois P. Heinz, Feb 01 2011
Showing 1-5 of 5 results.