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

A143641 Odd prime-proof numbers (A118118) not ending in 5.

Original entry on oeis.org

212159, 595631, 872897, 1203623, 1293671, 1566691, 1702357, 1830661, 3716213, 3964169, 4103917, 4134953, 4173921, 4310617, 4376703, 4586509, 4703801, 4749187, 4801387, 4928909, 5005353, 5051179, 5231739, 5258901, 5317573
Offset: 1

Views

Author

M. F. Hasler, Aug 27 2008, Sep 04 2008

Keywords

Comments

Most "prime-proof" numbers are even or multiples of 5, cf. A118118.
Nicol & Selfridge proved that this sequence is infinite. - Charles R Greathouse IV, Jan 27 2014

Crossrefs

Cf. A118118.

Programs

  • Magma
    IsA143641:=function(n); D:=Intseq(n); return Intseq(n)[1] ne 5 and forall{ : k in [1..#D], j in [0..9] | not IsPrime(Seqint(Insert(D, k, k, [j]))) }; end function; [ n: n in [1..4000000 by 2] | IsA143641(n) ]; // Klaus Brockhaus, Mar 03 2011
    
  • PARI
    forstep( i=1,10^7,2, i%5 || next; isA118118(i) && print1(i","))
    
  • Python
    from sympy import isprime
    from itertools import count, islice
    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 agen():
        for n in count(1, 2):
            if n%5 == 0: continue
            if all(not isprime(k) for k in selfplusneighs(n)):
                yield n
    print(list(islice(agen(), 8))) # Michael S. Branicky, Aug 16 2022

A050249 Weakly prime numbers (changing any one decimal digit always produces a composite number). Also called digitally delicate primes.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Tao proved that this sequence is infinite. - T. D. Noe, Mar 01 2011
For k = 5, 6, 7, 8, 9, 10, the number of terms < 10^k in this sequence is 0, 5, 35, 334, 3167, 32323. - Jean-Marc Rebert, Nov 10 2015

References

  • Michael Filaseta and Jeremiah Southwick, Primes that become composite after changing an arbitrary digit, Math. Comp. (2021) Vol. 90, 979-993. doi:10.1090/mcom/3593

Crossrefs

Cf. A118118, A158124 (weakly primes), A158125 (weakly primes).
Cf. A137985 (analogous base-2 sequence), A186995 (weak primes in base n).

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; [ p: p in PrimesUpTo(8000000) | IsA118118(p) ]; // Klaus Brockhaus, Feb 28 2011
    
  • Mathematica
    fQ[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[Prime@ Range[10^5], fQ] (* Michael De Vlieger, Nov 10 2015, Version 10 *)
  • PARI
    isokp(n) = {v = digits(n); for (k=1, #v, w = v; for (j=0, 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
        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])
    def ok(n): return isprime(n) and all(not isprime(k) for k in h1(n) if k!=n)
    print([k for k in range(10**6) if ok(k)]) # Michael S. Branicky, Jun 19 2022

Extensions

Edited by Charles R Greathouse IV, Aug 02 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 *)
Showing 1-3 of 3 results.