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.

A033274 Primes that do not contain any other prime as a proper substring.

This page as a plain text file.
%I A033274 #43 Apr 19 2025 13:29:30
%S A033274 2,3,5,7,11,19,41,61,89,101,109,149,181,401,409,449,491,499,601,691,
%T A033274 809,881,991,1009,1049,1069,1481,1609,1669,1699,1801,4001,4049,4481,
%U A033274 4649,4801,4909,4969,6091,6469,6481,6869,6949,8009,8069,8081,8609,8669,8681
%N A033274 Primes that do not contain any other prime as a proper substring.
%C A033274 If there is more than one digit, all digits must be nonprime numbers.
%C A033274 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
%C A033274 A079066(n) = 0 iff prime(n) is in this sequence. [Corrected by _M. F. Hasler_, Aug 27 2012]
%C A033274 What are the asymptotics of this sequence? - _Charles R Greathouse IV_, Aug 27 2012
%H A033274 Michael S. Branicky, <a href="/A033274/b033274.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..1000 from Zak Seidov)
%e A033274 149 is a term as 1, 4, 9, 14, 49 are all nonprimes.
%e A033274 199 is not a term as 19 is a prime.
%t A033274 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 *)
%t A033274 Select[Prime[Range[1100]],NoneTrue[Flatten[Table[FromDigits/@Partition[IntegerDigits[#],d,1],{d,IntegerLength[#]-1}]],PrimeQ]&] (* _Harvey P. Dale_, Apr 19 2025 *)
%o A033274 (Haskell)
%o A033274 import Data.List (elemIndices)
%o A033274 a033274 n = a033274_list !! (n-1)
%o A033274 a033274_list = map (a000040 . (+ 1)) $ elemIndices 0 a079066_list
%o A033274 -- _Reinhard Zumkeller_, Jul 19 2011
%o A033274 (Python)
%o A033274 from sympy import isprime
%o A033274 def ok(n):
%o A033274     if n in {2, 3, 5, 7}: return True
%o A033274     s = str(n)
%o A033274     if set(s) & {"2", "3", "5", "7"} or not isprime(n): return False
%o A033274     ss2 = set(s[i:i+l] for i in range(len(s)-1) for l in range(2, len(s)))
%o A033274     return not any(isprime(int(ss)) for ss in ss2)
%o A033274 print([k for k in range(9000) if ok(k)]) # _Michael S. Branicky_, Jun 29 2022
%Y A033274 Cf. A089768, A089770, A039996, A079397, A033274, A034844, A179909-A179919.
%K A033274 base,nonn
%O A033274 1,1
%A A033274 _Michael Kleber_
%E A033274 Edited by _N. J. A. Sloane_ at the suggestion of Luca Colucci, Apr 03 2008