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-10 of 19 results. Next

A158125 Weakly prime numbers in the sense of A158124 but not A050249.

Original entry on oeis.org

929573, 3070663, 5285767, 5974249, 7810223, 9262697, 9663683, 9700429, 10532453, 12968519, 19106729, 19158221, 19579907, 21825337, 23196157, 24328567, 29617897, 31181461, 31746383, 31839427, 36438379, 36745811, 37763641, 38585039, 38774851, 38888137, 39600559, 45412331, 45743483, 47500217, 47632271, 54127231, 56242891, 59816347
Offset: 1

Views

Author

Eric W. Weisstein, Mar 13 2009

Keywords

Comments

A158124: initial digit may not be changed to a zero (and hence give a number with fewer digits).
A050249: initial digit may be changed to a zero.
For the following values 5, 6, 7, 8, 9, 10 of k, the number of terms < 10^k in this sequence is 0, 1, 8, 72, 589, 4977. - Jean-Marc Rebert, Nov 10 2015
Intersection of A227916 and A158124. So primes p that give another prime when the first digit is removed, but give a composite number when any one digit is modified in a way that does not change the digit count. - Jeppe Stig Nielsen, Jan 16 2022

Crossrefs

Programs

  • PARI
    forprime(p=2,10^10,d=digits(p);!isprime(fromdigits(d[2..#d]))&&next();for(k=1,#d,for(j=(k==1),9,d[k]==j&&next();e=d;e[k]=j;isprime(fromdigits(e))&&next(3)));print1(p,", ")) \\ Jeppe Stig Nielsen, Jan 16 2022

A158576 a(n) = number of components of the graph P(n,10) (defined in Comments).

Original entry on oeis.org

1, 1, 1, 1, 1, 7, 38, 365, 3355, 33586
Offset: 1

Views

Author

W. Edwin Clark, Mar 21 2009

Keywords

Comments

Let H(n,b) be the Hamming graph whose vertices are the sequences of length n over the alphabet {0,1,...,b-1} with adjacency being defined by having Hamming distance 1. Let P(n,b) be the subgraph of H(n,b) induced by the set of vertices which are base b representations of primes with n digits (not allowing leading 0 digits).
For 6 and 7 digit primes there is a single large component and the remaining components have size 1. For 8 digit primes there is a single large component, the size 2 component {89391959, 89591959} and the remaining components have size 1. - W. Edwin Clark, Mar 31 2009
The elements of size 2 components in these graphs are sequence A253269. - Michael Kleber, May 04 2015

Examples

			The 6-digit primes 294001, 505447, 584141, 604171, 929573, 971767 (cf. A050249) have the property that changing any single digit always gives a composite number, so these are isolated nodes in the graph P(6,10) (which also has one large connected component).
		

Crossrefs

Extensions

a(8) from W. Edwin Clark, Mar 31 2009
a(9)-a(10) from Max Alekseyev, Dec 23 2024

A137985 Complementing any single bit in the binary representation of these primes does not produce a prime number.

Original entry on oeis.org

127, 173, 191, 223, 233, 239, 251, 257, 277, 337, 349, 373, 431, 443, 491, 509, 557, 653, 683, 701, 733, 761, 787, 853, 877, 1019, 1193, 1201, 1259, 1381, 1451, 1453, 1553, 1597, 1709, 1753, 1759, 1777, 1973, 2027, 2063, 2333, 2371, 2447, 2633, 2879, 2917, 2999
Offset: 1

Views

Author

T. D. Noe, Feb 26 2008

Keywords

Comments

If 2^m is the highest power of 2 in the binary representation of the prime p, there is no requirement that p+2^(m+1) be composite. Sequence A065092 imposes this extra requirement. The prime 223 is the first number in this sequence that is not in A065092.
Mentioned Feb 25 2008 by Terence Tao in his blog http://terrytao.wordpress.com. Tao proves that there are an infinite number of these primes in every fixed base.
Digitally delicate primes in base 2. - Marc Morgenegg, Apr 21 2021

Examples

			The numbers produced by complementing each of the 8 bits of 223 are 95, 159, 255, 207, 215, 219, 221 and 222, which are all composite.
		

Crossrefs

Cf. A050249 (analogous base 10 sequence), A186995 (weak primes in base n).
A065092 is a very similar sequence.

Programs

  • Maple
    q:= p-> isprime(p) and not ormap(i->isprime(Bits[Xor](p, 2^i)), [$0..ilog2(p)]):
    select(q, [$2..5000])[];  # Alois P. Heinz, Jul 28 2025
  • Mathematica
    t={}; k=1; While[Length[t]<100, k++; p=Prime[k]; d=IntegerDigits[p,2]; n=Length[d]; i=0; While[iT. D. Noe *)
    isWPbase2[z_] := NestWhile[#*2 &, 2, (# < z && ! PrimeQ@BitXor[z, #] &)] > z; Select[Prime /@ Range[3, PrimePi[10^6]], isWPbase2@# &] (* Terentyev Oleg, Jul 17 2011 *)
    Select[Prime[Range[500]], NoneTrue[BitXor[#, 2^Range[0, BitLength[#] - 1]], PrimeQ] &] (* Paolo Xausa, Apr 23 2025 *)
  • PARI
    f(p)={pow2=1;v=binary(p);L=#v;
    forstep(k=L,1,-1,if(v[k],p-=pow2;if(isprime(p),return(0),p+=pow2),p+=pow2;if(isprime(p),return(0),p-=pow2)); pow2*=2);return(1)}; forprime(p=2,2879,if(f(p), print1(p,", "))) \\ Washington Bomfim, Jan 18 2011
    
  • PARI
    is_A137985(n)=!for(k=1,n,isprime(bitxor(n,k)) && return;k+=k-1) && isprime(n) \\ Note: A bug in early versions of PARI 2.6 (execute "for(i=0,1,i>3 && error(buggy);i=9)" to check) makes that this is is_A065092 rather than is_A137985 as expected. For these versions, replace the upper limit n with n\2. \\ M. F. Hasler, Apr 05 2013
    
  • Python
    from sympy import isprime, primerange
    def ok(p): # p assumed prime
      return not any(isprime((1<Michael S. Branicky, Feb 16 2021

Extensions

Definition clarified by Chai Wah Wu, Jan 03 2019
Name edited by Paolo Xausa, Apr 24 2025

A186995 Smallest weak prime in base n.

Original entry on oeis.org

127, 2, 373, 83, 28151, 223, 6211, 2789, 294001, 3347, 20837899, 4751, 6588721, 484439, 862789, 10513, 2078920243, 10909, 169402249, 2823167, 267895961, 68543, 1016960933671, 181141, 121660507, 6139219, 11646280537, 488651
Offset: 2

Views

Author

T. D. Noe, Mar 01 2011

Keywords

Comments

In base b, a prime is said to be weakly prime if changing any digit produces only composite numbers. Tao proves that in any fixed base there are an infinite number of weakly primes.
In particular, changing the leading digit to 0 must produce a composite number. These are also called weak primes, weakly primes, and isolated primes. - N. J. A. Sloane, May 06 2019
a(24) > 10^11. - Jon E. Schoenfield, May 06 2019
a(30) > 2*10^12. - Giovanni Resta, Jun 17 2019
a(30) > 10^13. - Dana Jacobsen, Mar 25 2023
a(n) appears to be relatively smaller for n odd than for n even. For instance, a(31) = 356479, a(33) = 399946711, a(35) = 22549349, a(37) = 8371249. a(n) for n of the form 6k+3 appear to be relatively larger than a(n) for other odd n. a(n) for n of the form 6k appear to be relatively larger than a(n) for other even n. - Chai Wah Wu, Mar 24 2024

Crossrefs

Cf. A050249 (base 10), A137985 (base 2).

Programs

  • Mathematica
    isWeak[n_, base_] := Module[{d, e, weak, num}, d = IntegerDigits[n, base]; weak = True; Do[e = d; e[[i]] = j; num = FromDigits[e, base]; If[num != n && PrimeQ[num], weak = False; Break[]], {i, Length[d]}, {j, 0, base - 1}]; weak]; Table[p = 2; While[! isWeak[p, n], p = NextPrime[p]]; p, {n, 2, 16}]
  • Python
    from itertools import count
    from sympy import isprime
    from sympy.ntheory.digits import digits
    def fromdigits(d, b):
        n = 0
        for di in d: n *= b; n += di
        return n
    def h1(n, b): # hamming distance 1 neighbors of n in base b
        d = digits(n, b)[1:]; L = len(d)
        yield from (fromdigits(d[:i]+[c]+d[i+1:], b) for c in range(b) for i in range(L) if c!=d[i])
    def ok(n, b): return isprime(n) and all(not isprime(k) for k in h1(n, b))
    def a(n): return next(k for k in count(2) if ok(k, n))
    print([a(n) for n in range(2, 12)]) # Michael S. Branicky, Jul 31 2022
    
  • Python
    from sympy import isprime, nextprime
    from sympy.ntheory import digits
    def A186995(n):
        p = 2
        while True:
            s = digits(p,n)[1:]
            l = len(s)
            for i,j in enumerate(s[::-1]):
                m = n**i
                for k in range(n):
                    if k!=j and isprime(p+(k-j)*m):
                        break
                else:
                    continue
                break
            else:
                return p
            p = nextprime(p) # Chai Wah Wu, Mar 24 2024

Extensions

a(17)-a(23) from Terentyev Oleg, Sep 04 2011
a(24)-a(29) from Giovanni Resta, Jun 17 2019

A158124 Weakly prime numbers (or isolated primes): changing any one decimal digit always produces a composite number, with restriction that first digit may not be changed to a 0.

Original entry on oeis.org

294001, 505447, 584141, 604171, 929573, 971767, 1062599, 1282529, 1524181, 2017963, 2474431, 2690201, 3070663, 3085553, 3326489, 4393139, 5152507, 5285767, 5564453, 5575259, 5974249, 6173731, 6191371, 6236179, 6463267, 6712591, 7204777, 7469789, 7469797, 7810223
Offset: 1

Views

Author

Eric W. Weisstein, Mar 13 2009

Keywords

Comments

The definition could be restated as "primes p with d digits such that there is no prime q with at most d digits at Hamming distance 1 from p (in base 10)". - N. J. A. Sloane, May 06 2019
For the following values of k, 5, 6, 7, 8, 9, 10, the number of terms < 10^k in this sequence is 0, 6, 43, 406, 3756, 37300. - Jean-Marc Rebert, Nov 10 2015

Crossrefs

Cf. A050249, A158125 (weakly primes), A186995, A192545.

Programs

  • Maple
    filter:= proc(n)
      local L,i,d,ds;
      if not isprime(n) then return false fi;
      L:= convert(n,base,10);
      for i from 1 to nops(L) do
        if i = nops(L) then ds:= {$1..9} minus {L[i]}
        elif i = 1 then ds:= {1,3,7,9} minus {L[i]}
        else ds:= {$0..9} minus {L[i]}
        fi;
        for d in ds do
          if isprime(n + (d - L[i])*10^(i-1)) then return false fi;
        od
      od;
      true
    end proc:
    select(filter, [seq(i,i=11..10^6,2)]); # Robert Israel, Dec 15 2015
  • Mathematica
    Select[Prime@ Range[10^5], Function[n, Function[w, Total@ Map[Boole@ PrimeQ@ # &, DeleteCases[#, n]] &@ Union@ Flatten@ Map[Function[d, FromDigits@ ReplacePart[w, d -> #] & /@ If[d == 1, #, Prepend[#, 0]] &@ Range@ 9], Range@ Length@ w] == 0]@ IntegerDigits@ n]] (* Michael De Vlieger, Dec 13 2016 *)
  • PARI
    isokp(n) = {v = digits(n); for (k=1, #v, w = v; if (k==1, idep = 1, idep=0); for (j=idep, 9, if (j != v[k], w[k] = j; ntest = subst(Pol(w), x, 10); if (isprime(ntest), return(0));););); return (1);}
    lista(nn) = {forprime(p=2, nn, if (isokp(p), print1(p, ", ")););} \\ Michel Marcus, Dec 15 2015
    
  • Python
    from sympy import isprime
    def h1(n): # hamming distance 1 neighbors of n, not starting with 0
        s = str(n); d = "0123456789"; L = len(s)
        yield from (int(s[:i]+c+s[i+1:]) for c in d for i in range(L) if c!=s[i] and not (i==0 and c=="0"))
    def ok(n): return isprime(n) and all(not isprime(k) for k in h1(n))
    print([k for k in range(10**6) if ok(k)]) # Michael S. Branicky, Jul 31 2022

Extensions

Edited by Charles R Greathouse IV, Aug 02 2010
Missing a(3385) inserted into b-file by Andrew Howroyd, Feb 23 2018

A118118 Composite numbers that always remain composite when a single decimal digit of the number is changed.

Original entry on oeis.org

200, 204, 206, 208, 320, 322, 324, 325, 326, 328, 510, 512, 514, 515, 516, 518, 530, 532, 534, 535, 536, 538, 620, 622, 624, 625, 626, 628, 840, 842, 844, 845, 846, 848, 890, 892, 894, 895, 896, 898, 1070, 1072, 1074, 1075, 1076, 1078, 1130
Offset: 1

Views

Author

Adam Panagos (adam.panagos(AT)gmail.com), May 12 2006

Keywords

Comments

The term "prime-proof" for this property is found on projecteuler.net (cf. link). The nontrivial subsequence A143641 is that of odd elements not ending in 5 (i.e. not ending in 0,2,4,5,6 or 8); it starts 212159,595631,872897,... - M. F. Hasler, Sep 04 2008
Also indices n such that A209252(n) is zero. - Ray G. Opao, Aug 01 2020

Examples

			a(1) = 200 is in the sequence because changing any digit of 200 (for example 300, 220, or 209) is still composite. The integer 100 is not in the sequence because it can be changed to 107 which is prime.
		

Crossrefs

Programs

  • Magma
    IsA118118:=function(n); D:=Intseq(n); return forall{ : k in [1..#D], j in [0..9] | j eq D[k] or not IsPrime(Seqint(S)) where S:=Insert(D, k, k, [j]) }; end function; [ n: n in [1..1200] | IsA118118(n) ]; // Klaus Brockhaus, Feb 28 2011
    
  • Mathematica
    unprimeableQ[n_] := Block[{d = IntegerDigits@ n, t = {}}, Do[AppendTo[t, FromDigits@ ReplacePart[d, i -> #] & /@ DeleteCases[Range[0, 9], x_ /; x == d[[i]]]], {i, Length@ d}]; ! AnyTrue[Flatten@ t, PrimeQ]]; Select[Range@ 1200, unprimeableQ] (* Michael De Vlieger, Nov 09 2015, Version 10 *)
  • PARI
    /* return 1 if no digit can be changed to make it prime; if d=1, print a prime if n is not prime-proof */ isA118118(n,d=0)={ forstep( k=n\10*10+1, n\10*10+9,2, isprime(k) || next; d && print("prime:",k); return); if( n%2==0 || n%5==0, /* even or ending in 5: no other digit can make it prime, except for the case where the last digit is prime and the first digit is the only other nonzero one */ return( !isprime(n%10) || 9 < n % 10^( log(n+.5)\log(10) ) || (d && print("prime:",n%10)) )); o=10; until( n < o*=10, k=n-o*(n\o%10); for( i=0,9, isprime(k) && return(d && print("prime:",k)); k+=o));1} \\ M. F. Hasler, Sep 04 2008
    
  • Python
    from sympy import isprime
    def selfplusneighs(n):
        s = str(n); d = "0123456789"; L = len(s)
        yield from (int(s[:i]+c+s[i+1:]) for c in d for i in range(L))
    def ok(n): return all(not isprime(k) for k in selfplusneighs(n))
    print([k for k in range(1131) if ok(k)]) # Michael S. Branicky, Jun 19 2022

Extensions

Edited by Charles R Greathouse IV, Aug 05 2010

A192545 Numbers such that all numbers are composite when replacing exactly one digit with another, except the leading digit with zero.

Original entry on oeis.org

200, 202, 204, 205, 206, 208, 320, 322, 324, 325, 326, 328, 510, 512, 514, 515, 516, 518, 530, 532, 534, 535, 536, 538, 620, 622, 624, 625, 626, 628, 840, 842, 844, 845, 846, 848, 890, 892, 894, 895, 896, 898, 1070, 1072, 1074, 1075, 1076, 1078, 1130, 1132
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 05 2011

Keywords

Comments

A048853(a(n)) = 0;
Intersection of this sequence and A000040 is A158124. - Evgeny Kapun, Dec 13 2016
If the last digit of an element is 0, 2, 4, 5, 6 or 8, then replacing it with 0, 2, 4, 5, 6 or 8 also yields an element. - David A. Corneth and corrected by Evgeny Kapun, Dec 13 2016

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a192545 n = a192545_list !! (n-1)
    a192545_list = map (+ 1) $ elemIndices 0 $ map a048853 [1..]
  • Mathematica
    Select[Range@ 1200, Function[w, Total@ Boole@ Flatten@ Map[Function[d, PrimeQ@ FromDigits@ ReplacePart[w, d -> #] & /@ If[d == 1, #, Prepend[#, 0]] &@ Range@ 9], Range@ Length@ w] == 0]@ IntegerDigits@ # &] (* Michael De Vlieger, Dec 13 2016 *)

A193890 Primes p such that replacing any single decimal digit d with 3*d produces another prime (obviously p can contain only digits 0, 1, 2 or 3).

Original entry on oeis.org

11, 311, 1301, 10133, 1030031
Offset: 1

Views

Author

Arkadiusz Wesolowski, Aug 08 2011

Keywords

Comments

These numbers do not occur in A050249 (weakly associated primes).
p cannot contain digits 1 and 2 at the same time due to divisibility by 3.
No more terms < 10^9. [Reinhard Zumkeller, Aug 11 2011]
No more terms < 10^14. - Arkadiusz Wesolowski, Feb 08 2012
No more terms < 10^18. - Giovanni Resta, Feb 23 2013
No more terms < 10^22. - Jan van Delden, Mar 06 2016
The number of occurrences of the digit 1 or 2 is congruent to 2 (mod 3). - Robert Israel, Mar 07 2016

Examples

			1301 belongs to this sequence because 1303, 1301, 1901 and 3301 are all prime.
		

Crossrefs

Programs

  • Haskell
    import Data.List (inits, tails)
    a193890 n = a193890_list !! (n-1)
    a193890_list = filter f a107715_list where
       f n = (all ((== 1) . a010051) $
                   zipWith (\ins (t:tns) -> read $ (ins ++ x3 t ++ tns))
                           (init $ inits $ show n) (init $ tails $ show n))
           where x3 '0' = "0"
                 x3 '1' = "3"
                 x3 '2' = "6"
                 x3 '3' = "9"
    -- Reinhard Zumkeller, Aug 11 2011
    
  • Maple
    S:= NULL:
    for x from 2 to 3^10 do
       L:= convert(x, base, 3):
       if numboccur(1,L) mod 3 <> 2 then next fi;
       L1:= subs(2=3,L);
       L2:= subs(1=2,L1);
       for LL in [L1,L2] do
         y:= add(LL[i]*10^(i-1), i=1..nops(L1));
         if isprime(y) then
          good:= true;
          for j from 1 to nops(LL) do
             yp:= y + 2*LL[j]*10^(j-1);
             if not isprime(yp) then
                good:= false;
                break
             fi
          od:
          if good then S:= S, y fi;
         fi;
       od
    od:
    sort([S]); # Robert Israel, Mar 07 2016
  • Mathematica
    Select[Select[Prime@ Range[10^6], AllTrue[IntegerDigits@ #, MemberQ[{0, 1, 2, 3}, #] &] &], Function[k, AllTrue[Map[FromDigits, Map[MapAt[3 # &, IntegerDigits@ k, #] &, Range@ IntegerLength@ k]], PrimeQ]]] (* Michael De Vlieger, Mar 06 2016, Version 10 *)
  • Python
    from sympy import isprime
    from itertools import product
    A193890_list = []
    for l in range(1,10):
        for d in product('0123',repeat=l):
            p = int(''.join(d))
            if d[0] != '0' and d[-1] in ('1','3') and isprime(p):
                for i in range(len(d)):
                    d2 = list(d)
                    d2[i] = str(3*int(d[i]))
                    if not isprime(int(''.join(d2))):
                        break
                else:
                     A193890_list.append(p) # Chai Wah Wu, Aug 13 2015

A253269 Weakly Twin Primes in base 10: Can only reach one other prime by single-decimal-digit changes.

Original entry on oeis.org

89391959, 89591959, 519512471, 519512473, 531324041, 561324041, 699023791, 699023891, 874481011, 874487011, 1862537503, 2232483271, 2232483871, 2608559351, 3127181789, 3157181789, 3928401949, 3928401989, 4070171669, 4070171969, 5225628323, 5309756339, 5525628323
Offset: 1

Views

Author

Michael Kleber, May 01 2015

Keywords

Comments

Each pair of twins here form a size-two connected component in the graph considered in A158576.
A naive heuristic argument based on the density of primes claims that this sequence should be infinite, and in fact that a positive proportion of all primes should have this property. A prime p has 9*log_10(p) neighbors, each prime with "probability" 1/log(p), and with all the other 2*9*log_10(p) neighbors being composite with "probability" (1-1/log(p))^(2*9*log_10(p)). For a large prime p, this goes to the limit 9/(exp(18/log(10))*log(10)), or about 0.16%. The fact that base-10 primes need to end with digit 1/3/7/9 will change the value of this probability, but won't change the fact that it is nonzero.
This is analogous to a theorem about weakly prime numbers; see the Terence Tao paper referenced in A050249.

Crossrefs

Programs

  • Mathematica
    NeighborsAndSelf[n_] := Flatten[MapIndexed[Table[ n + (i - #)*10^(#2[[1]] - 1), {i, 0, 9}] &, Reverse[IntegerDigits[n, 10]]]]
    PrimeNeighbors[n_] := Complement[Select[NeighborsAndSelf[n],PrimeQ],{n}]
    WeaklyTwinPrime[p_] := (Length[#] == 1 && PrimeNeighbors[#[[1]]] == {p}) &[PrimeNeighbors[p]]
    For[k = 0, k <= PrimePi[10^10], k++, If[WeaklyTwinPrime[Prime[k]], Print[Prime[k]]]]

A226144 Primes p that become composite when any nonzero decimal digit is appended or deleted on the right or left of p.

Original entry on oeis.org

1301, 3989, 4931, 5387, 6803, 7451, 7703, 7753, 10303, 10657, 10723, 11971, 12119, 12329, 12541, 12653, 12907, 12983, 13693, 13729, 13789, 14207, 14251, 14303, 14411, 14821, 15131, 15217, 15383, 15619, 15629, 15913, 16231, 16487, 17137, 17627, 17807, 17929
Offset: 1

Views

Author

W. Edwin Clark, May 27 2013

Keywords

Comments

Among the first million primes, 99272 of them are of this type. This sequence was suggested by Carlos Rivera's Puzzle 690 (see link below).

Examples

			1301 is prime, but the numbers 301, 130, x1301, 1301x are composite for any x in {1,2,3,4,5,6,7,8,9}.
		

Crossrefs

Cf. A050249 (weakly prime numbers: changing any one decimal digit always produces a composite number).

Programs

  • Maple
    with(StringTools):
    LL:=Explode("123456789"):
    IsIsolated:=proc(p)
    global LL;
    local L,x,q,i,t;
    L:=Explode(convert(p,string));
       for x in LL do
          t:=[x,seq(L[i],i=1..nops(L))];
          q:=parse(Implode(t));
          if isprime(q) then return false; fi;
          t:=[seq(L[i],i=1..nops(L)),x];
          q:=parse(Implode(t));
          if isprime(q) then return false; fi;
       od:
       t:=[seq(L[i],i=1..nops(L)-1)];
       if t <> [] then
          q:=parse(Implode(t));
          if isprime(q)  then return false; fi;
       fi;
       t:=[seq(L[i],i=2..nops(L))];
       if t <> [] then
          q:=parse(Implode(t));
          if isprime(q)  then return false; fi;
       fi;
    return true;
    end proc:
    a:=NULL;
    for i from 1 to 20000 do
    p:=ithprime(i);
    if IsIsolated(p) then a:=a,p; fi;
    od:
    a;  # W. Edwin Clark, May 28 2013
  • Mathematica
    noPrimesQ[p_] := Module[{d = IntegerDigits[p],  tens = 10^Ceiling[Log[10, p]]}, ! PrimeQ[FromDigits[Rest[d]]] && ! PrimeQ[FromDigits[Most[d]]] && ! PrimeQ[10*p + 1] && ! PrimeQ[10*p + 3] && ! PrimeQ[10*p + 7] && ! PrimeQ[10*p + 9] && ! PrimeQ[1*tens + p] && ! PrimeQ[2*tens + p] && ! PrimeQ[3*tens + p] && ! PrimeQ[4*tens + p] && ! PrimeQ[5*tens + p] && ! PrimeQ[6*tens + p] && ! PrimeQ[7*tens + p] && ! PrimeQ[8*tens + p] && ! PrimeQ[9*tens + p]]; t = {}; Do[If[noPrimesQ[p], AppendTo[t, p]], {p, Prime[Range[PrimePi[20000]]]}]; t (* T. D. Noe, May 28 2013 *)
    pbcQ[p_]:=Module[{idp=IntegerDigits[p],lm1,rm1,lft,rt},lm1 = FromDigits[ Most[ idp]];rm1=FromDigits[Rest[idp]];lft= Table[ l*10^Length[idp]+p,{l,9}]; rt=Table[10*p+r,{r,9}];AllTrue[ Flatten[ Join[ {lm1,rm1,lft,rt}]],CompositeQ]]; Select[ Prime[ Range[ 2100]],pbcQ] (* Harvey P. Dale, Dec 20 2021 *)
Showing 1-10 of 19 results. Next