Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #27 Sep 28 2023 08:17:05
%S 212159,595631,872897,1203623,1293671,1566691,1702357,1830661,3716213,
%T 3964169,4103917,4134953,4173921,4310617,4376703,4586509,4703801,
%U 4749187,4801387,4928909,5005353,5051179,5231739,5258901,5317573
%N Odd prime-proof numbers (A118118) not ending in 5.
%C Most "prime-proof" numbers are even or multiples of 5, cf. A118118.
%C Nicol & Selfridge proved that this sequence is infinite. - _Charles R Greathouse IV_, Jan 27 2014
%H Michael S. Branicky, <a href="/A143641/b143641.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..3655 from Klaus Brockhaus)
%H Michael Filaseta, Mark Kozek, Charles Nicol and John Selfridge, <a href="http://www.math.sc.edu/~filaseta/papers/FKNSpaper0808.pdf">Composites that remain composite after changing a digit</a>, Journal of Combinatorics and Number Theory 2 (2011), pp. 25-36.
%H Project Euler, <a href="http://projecteuler.net/problem=200">Problem 200: Prime-proof Squbes</a> (2008).
%o (PARI) forstep( i=1,10^7,2, i%5 || next; isA118118(i) && print1(i","))
%o (Magma) IsA143641:=function(n); D:=Intseq(n); return Intseq(n)[1] ne 5 and forall{ <k, j>: 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
%o (Python)
%o from sympy import isprime
%o from itertools import count, islice
%o def selfplusneighs(n):
%o s = str(n); d = "0123456789"; L = len(s)
%o yield from (int(s[:i]+c+s[i+1:]) for c in d for i in range(L))
%o def agen():
%o for n in count(1, 2):
%o if n%5 == 0: continue
%o if all(not isprime(k) for k in selfplusneighs(n)):
%o yield n
%o print(list(islice(agen(), 8))) # _Michael S. Branicky_, Aug 16 2022
%Y Cf. A118118.
%K base,nonn
%O 1,1
%A _M. F. Hasler_, Aug 27 2008, Sep 04 2008