OFFSET
1,1
COMMENTS
If there is more than one digit, all digits must be nonprime numbers.
A179335(n) = prime(n) iff prime(n) is in this sequence. For n > 4, prime(n) is in this sequence iff A109066(n) = 0. - Reinhard Zumkeller, Jul 11 2010, corrected by M. F. Hasler, Aug 27 2012
A079066(n) = 0 iff prime(n) is in this sequence. [Corrected by M. F. Hasler, Aug 27 2012]
What are the asymptotics of this sequence? - Charles R Greathouse IV, Aug 27 2012
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000 (terms 1..1000 from Zak Seidov)
EXAMPLE
149 is a term as 1, 4, 9, 14, 49 are all nonprimes.
199 is not a term as 19 is a prime.
MATHEMATICA
f[n_] := Block[ {id = IntegerDigits@n}, len = Length@ id - 1; Count[ PrimeQ@ Union[ FromDigits@# & /@ Flatten[ Table[ Partition[ id, k, 1], {k, len}], 1]], True] + 1]; Select[ Prime@ Range@ 1100, f@# == 1 &] (* Robert G. Wilson v, Aug 01 2010 *)
PROG
(Haskell)
import Data.List (elemIndices)
a033274 n = a033274_list !! (n-1)
a033274_list = map (a000040 . (+ 1)) $ elemIndices 0 a079066_list
-- Reinhard Zumkeller, Jul 19 2011
(Python)
from sympy import isprime
def ok(n):
if n in {2, 3, 5, 7}: return True
s = str(n)
if set(s) & {"2", "3", "5", "7"} or not isprime(n): return False
ss2 = set(s[i:i+l] for i in range(len(s)-1) for l in range(2, len(s)))
return not any(isprime(int(ss)) for ss in ss2)
print([k for k in range(9000) if ok(k)]) # Michael S. Branicky, Jun 29 2022
CROSSREFS
KEYWORD
base,nonn
AUTHOR
EXTENSIONS
Edited by N. J. A. Sloane at the suggestion of Luca Colucci, Apr 03 2008
STATUS
approved