A089769 Duplicate of A033274.
2, 3, 5, 7, 11, 19, 41, 61, 89, 101, 109, 149, 181, 401, 409, 449, 491, 499, 601, 691, 809
Offset: 1
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.
E.g. 149 is a prime made of nonprime digits(1,4,9). 991 is a prime without any prime digits.
a034844 n = a034844_list !! (n-1) a034844_list = filter (not . any (`elem` "2357") . show ) a000040_list -- Reinhard Zumkeller, Jul 19 2011
[p: p in PrimesUpTo(2000) | forall{d: d in [2,3,5,7] | d notin Set(Intseq(p))}]; // Bruno Berselli, Jul 27 2011
Select[Prime[Range[279]], Intersection[IntegerDigits[#], {2, 3, 5, 7}] == {} &] (* Jayanta Basu, Apr 18 2013 *) Union[Select[Flatten[Table[FromDigits/@Tuples[{1,4,6,8,9,0},n],{n,2,4}]],PrimeQ]] (* Harvey P. Dale, Dec 08 2014 *)
is_A034844(n)=isprime(n)&!apply(x->isprime(x),eval(Vec(Str(n)))) \\ M. F. Hasler, Aug 27 2012
is_A034844(n)=isprime(n)&!setintersect(Set(Vec(Str(n))),Vec("2357")) \\ M. F. Hasler, Aug 27 2012
from sympy import isprime from itertools import product def auptod(maxdigits): alst = [] for d in range(1, maxdigits+1): for p in product("014689", repeat=d-1): if d > 1 and p[0] == "0": continue for end in "19": s = "".join(p) + end t = int(s) if isprime(t): alst.append(t) return alst print(auptod(4)) # Michael S. Branicky, Nov 19 2021
The primes contained as substrings in prime(3) = 113 are 3, 11, 13. Hence a(30) = 3. 113 is the smallest prime with memory = 3.
import Data.List (isInfixOf) a079066 n = length $ filter (`isInfixOf` (primesDec !! n)) $ take n primesDec primesDec = "_" : map show a000040_list -- Reinhard Zumkeller, Jul 19 2011
a:= n-> (s-> -1+nops(select(t -> t[1]<>"0" and isprime(parse(t)), {seq(seq(s[i..j], i=1..j), j=1..length(s))})))(""||(ithprime(n))): seq(a(n), n=1..105); # Alois P. Heinz, Jul 29 2025
ub = 105; tprime = Table[ToString[Prime[i]], {i, 1, ub}]; a = {}; For[i = 1, i <= ub, i++, m = 0; For[j = 1, j < i, j++, If[Length[StringPosition[tprime[[i]], tprime[[j]]]] > 0, m = m + 1]]; a = Append[a, m]]; a
import Data.List (elemIndices) a179909 n = a179909_list !! (n-1) a179909_list = map (a000040 . (+ 1)) $ elemIndices 1 a079066_list -- Reinhard Zumkeller, Jul 19 2011
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@ 230, f@# == 2 &]
import Data.List (elemIndices) a179919 n = a179919_list !! (n-1) a179919_list = map (a000040 . (+ 1)) $ elemIndices 11 a079066_list -- Reinhard Zumkeller, Jul 19 2011
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@ 19110, f@# == 12 &]
A179335(n)={my(p=prime(n),m=0,M); for(d=1,n, M=10^d; n=p; until(n<=M || !n\=10, isprime(n%M) & (!m || m>n%M) & m=n%M); m & return(m))} \\ M. F. Hasler, Aug 27 2012
from sympy import isprime, prime def a(n): s = str(prime(n)) ss = set(int(s[i:i+1+l]) for i in range(len(s)) for l in range(len(s))) return min(t for t in ss if isprime(t)) print([a(n) for n in range(1, 94)]) # Michael S. Branicky, Jun 29 2022
a(3) = 149 is a term as 1,4,9,14,49 are all nonprimes. 199 is not a member as 19 is a prime.
N:= 1000: # to get terms until the first where a(n) > 10^(n-1)+10*N+9 filter1:= proc(x) local k,j; for k from 0 to ilog10(x) do for j from k to ilog10(x)+1 do if isprime(floor((x mod 10^j)/10^k)) then return false fi; od od: true end proc: X:= select(filter1, [seq(seq(10*i+j,j=[1,9]),i=0..N)]): filter2:= proc(p,x) local k,j; if not isprime(p) then return false fi; for k from 1 to ilog10(x)+1 do if isprime(floor(p /10^k)) then return false fi od; true; end proc: for n from 1 do found:= false; for x in X do p:= 10^(n-1)+x; if filter2(p,x) then A[n]:= p; found:= true; break fi; od: if not found then break fi od: seq(A[i],i=1..n-1); # Robert Israel, Dec 09 2017
import Data.List (elemIndices) a179922 n = a179922_list !! (n-1) a179922_list = map (a000040 . (+ 1)) $ elemIndices 12 a079066_list -- Reinhard Zumkeller, Jul 19 2011
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@ 43150, f@# == 13 &]
cbd:= proc(n) local x,L,i,flag; L:= convert(n,base,10); x:= n; for i from nops(L) to 1 by -1 do if member(L[i],{2,3,5,7}) then flag:= true; if L[i] = 3 then x:= x - 10^(i-1)- (x mod 10^(i-1)) -1 else x:= x - (x mod 10^(i-1)) - 1 fi; return x fi; od; x end proc: nps:= proc(n) option remember; if n <= 10 then not isprime(n) else not isprime(n) and nps(floor(n/10)) and nps(n mod 10^ilog10(n)) fi end proc: npps:= proc(n) local L,i,t; if n <= 10 then true else if n::odd then return nps(floor(n/10)) and nps(n mod 10^ilog10(n)) fi; for i from 1 do t:= floor(n/10^i); if t::odd then return nps(t) and nps(t mod 10^ilog10(t)) elif t = 0 then return true fi od fi end proc: g:= proc(n) local p,i,x; p:= 10^n; do p:= prevprime(p); x:= cbd(p); while x <> p do p:= prevprime(x+1); x:= cbd(p) od; if npps(p) then return p fi od end proc: g(1):= 7: map(g, [$1..30]); # Robert Israel, Aug 30 2024
from sympy import isprime from itertools import product def c(s): return not any(isprime(int(s[i:j])) for i in range(len(s)-1, -1, -1) for j in range(len(s), i, -1) if (i, j) != (0, len(s))) def a(n): if n == 1: return 7 return next(t for p in product("986410", repeat=n-1) for last in "91" if isprime(t:=int(s:="".join(p)+last)) and c(s)) print([a(n) for n in range(1, 23)]) # Michael S. Branicky, Aug 30 2024
Comments