A217112
Greatest number (in decimal representation) with n nonprime substrings in binary representation (substrings with leading zeros are considered to be nonprime).
Original entry on oeis.org
1, 3, 7, 6, 15, 14, 31, 29, 30, 63, 61, 62, 127, 54, 125, 126, 255, 117, 251, 254, 189, 511, 479, 509, 510, 379, 502, 1023, 1021, 1007, 1022, 958, 1018, 1014, 2047, 2045, 1791, 2046, 2042, 2027, 2037, 4091, 4095, 4063, 3069, 4094, 4090, 4085, 8159, 8187, 8191, 8189, 8127
Offset: 1
(1) = 1, since 1 = 1_2 (binary) is the greatest number with 1 nonprime substring.
a(2) = 3 = 11_2 has 3 substrings in binary representation (1, 1 and 11), two of them are nonprime substrings (1 and 1), and 11_2 = 3 is the only prime substrings. 3 is the greatest number with 2 nonprime substrings.
a(8) = 29 = 11101_2 has 15 substrings in binary representation (0, 1, 1, 1, 1, 11, 11, 10, 01, 111, 110, 101, 1110, 1101, 11101), exactly 8 of them are nonprime substrings (0, 1, 1, 1, 1, 01, 110, 1110). There is no greater number with 8 nonprime substrings in binary representation.
a(14) = 54 = 110110_2 has 21 substrings in binary representation, only 7 of them are prime substrings (10, 10, 11, 11, 101, 1011, 1101), which implies that exactly 14 substrings must be nonprime. There is no greater number with 14 nonprime substrings in binary representation.
A217119
Greatest number (in decimal representation) with n nonprime substrings in base-9 representation (substrings with leading zeros are considered to be nonprime).
Original entry on oeis.org
47, 428, 1721, 6473, 14033, 35201, 58961, 58967, 465743, 530701, 530710, 1733741, 4250788, 4723108, 4776398, 25051529, 37327196, 42450640, 42986860, 42987589, 42996409, 225463817, 382055767, 382571822, 386888308, 386888419, 387356789
Offset: 0
a(0) = 47, since 47 = 52_9 (base-9) is the greatest number with zero nonprime substrings in base-9 representation.
a(1) = 428 = 525_9 has 1 nonprime substring in base-9 representation (= 525_9). All the other base-9 substrings (2, 5, 5, 25, 52) are prime substrings. 525_9 is the greatest number with 1 nonprime substring.
a(2) = 1721 = 2322_9 has 10 substrings in base-9 representation, exactly 2 of them are nonprime substrings (22_9 and 23_3=8), and there is no greater number with 2 nonprime substrings in base-9 representation.
a(7) = 58967= 88788_9 has 15 substrings in base-9 representation, exactly 7 of them are nonprime substrings (4-times 8, 2-times 88, and 8788), and there is no greater number with 7 nonprime substrings in base-9 representation.
A152313
Primes without 0's or primes in their decimal expansion.
Original entry on oeis.org
11, 19, 41, 61, 89, 149, 181, 191, 199, 419, 449, 461, 491, 499, 619, 641, 661, 691, 811, 881, 911, 919, 941, 991, 1181, 1481, 1489, 1499, 1619, 1669, 1699, 1811, 1861, 1889, 1949, 1999, 4111, 4441, 4481, 4649, 4691, 4861, 4889, 4919, 4969, 4999
Offset: 1
-
[p: p in PrimesUpTo(5000) | Set(Intseq(p)) subset [1,4,6,8,9]]; // Vincenzo Librandi, Oct 25 2016
-
F:= proc(d) local T, R, L, r;
R:= NULL;
T:= combinat:-cartprod([[1,4,6,8,9]$d]);
while not T[finished] do
L:= T[nextvalue]();
r:= add(L[i]*10^(d-i),i=1..d);
if isprime(r) then R:= R,r fi
od;
R
end proc:
seq(F(d),d=2..5); # Robert Israel, Dec 07 2017
-
Select[Prime[Range[800]], Complement[IntegerDigits[#], {1, 4, 6, 8, 9}] == {} &] (* Vincenzo Librandi, Oct 25 2016 *)
A214705
Primes that contain only the digits (2, 5, 7).
Original entry on oeis.org
2, 5, 7, 227, 257, 277, 557, 577, 727, 757, 2557, 2777, 5227, 5527, 5557, 7577, 7727, 7757, 22277, 22727, 22777, 25577, 27277, 27527, 52727, 52757, 57527, 57557, 57727, 72227, 72277, 72577, 72727, 75227, 75277, 75527, 75557, 75577, 77527, 77557, 222527, 222557
Offset: 1
-
[p: p in PrimesUpTo(100000) | Set(Intseq(p)) subset [2,5,7]];
-
Flatten[Table[Select[FromDigits/@Tuples[{2,5,7},n],PrimeQ],{n,6}]]
-
from sympy import primerange
def ok(p): return set(str(p)) <= set("257")
def aupto(limit): return [p for p in primerange(2, limit+1) if ok(p)]
print(aupto(222557)) # Michael S. Branicky, Feb 05 2021
A083185
Palindromic primes using only nonprime digits (0,1,4,6,8,9).
Original entry on oeis.org
11, 101, 181, 191, 919, 10601, 11411, 16061, 16661, 18181, 18481, 19891, 19991, 91019, 94049, 94649, 94849, 94949, 96469, 98689, 1008001, 1114111, 1160611, 1180811, 1186811, 1190911, 1196911, 1409041, 1411141, 1444441, 1461641
Offset: 1
Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), Apr 26 2003
-
Select[ Prime[ Range[111500]], IntegerDigits[ # ] == Reverse[ IntegerDigits[ # ]] && Union[ Join[ IntegerDigits[ # ], {0, 1, 4, 6, 8, 9}]] == {0, 1, 4, 6, 8, 9} & ]
Select[Prime[Range[120000]],PalindromeQ[#]&&NoneTrue[IntegerDigits[#], PrimeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Mar 08 2018 *)
A085557
Numbers that have more prime digits than nonprime digits.
Original entry on oeis.org
2, 3, 5, 7, 22, 23, 25, 27, 32, 33, 35, 37, 52, 53, 55, 57, 72, 73, 75, 77, 122, 123, 125, 127, 132, 133, 135, 137, 152, 153, 155, 157, 172, 173, 175, 177, 202, 203, 205, 207, 212, 213, 215, 217, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232
Offset: 1
133 is in the sequence as the prime digits are 3 and 3 (those are two digits; counted with multiplicity) and one nonprime digit 1 and so there are more prime digits than nonprime digits. - _David A. Corneth_, Sep 06 2020
Cf.
A193238,
A046034,
A046035,
A118950,
A019546,
A203263,
A035232,
A039996,
A085823,
A052382,
A084544,
A084984,
A017042,
A001743,
A001744,
A014261,
A014263,
A202267,
A202268,
A211681.
-
is(n) = my(d = digits(n), c = 0); for(i = 1, #d, if(isprime(d[i]), c++)); c<<1 > #d \\ David A. Corneth, Sep 06 2020
-
from itertools import count, islice
def A085557_gen(startvalue=1): # generator of terms
return filter(lambda n:len(s:=str(n))<(sum(1 for d in s if d in {'2','3','5','7'})<<1),count(max(startvalue,1)))
A085557_list = list(islice(A085557_gen(),20)) # Chai Wah Wu, Feb 08 2023
A092624
Numbers with exactly two prime digits.
Original entry on oeis.org
22, 23, 25, 27, 32, 33, 35, 37, 52, 53, 55, 57, 72, 73, 75, 77, 122, 123, 125, 127, 132, 133, 135, 137, 152, 153, 155, 157, 172, 173, 175, 177, 202, 203, 205, 207, 212, 213, 215, 217, 220, 221, 224, 226, 228, 229, 230, 231, 234, 236, 238, 239, 242, 243, 245
Offset: 1
25 has two prime digits, 2 and 5;
207 has two prime digits, 2 and 7.
-
import Data.List (elemIndices)
a092624 n = a092624_list !! (n-1)
a092624_list = elemIndices 2 a193238_list
-- Reinhard Zumkeller, Jul 19 2011
-
stev_sez:=proc(n) local i, tren, st, ans, anstren; ans:=[ ]: anstren:=[ ]: tren:=n: for i while (tren>0) do st:=round( 10*frac(tren/10) ): ans:=[ op(ans), st ]: tren:=trunc(tren/10): end do; for i from nops(ans) to 1 by -1 do anstren:=[ op(anstren), op(i,ans) ]; od; RETURN(anstren); end: ts_stpf:=proc(n) local i, stpf, ans; ans:=stev_sez(n): stpf:=0: for i from 1 to nops(ans) do if (isprime(op(i,ans))='true') then stpf:=stpf+1; # number of prime digits fi od; RETURN(stpf) end: ts_pr_nd:=proc(n) local i, stpf, ans, ans1, tren; ans:=[ ]: stpf:=0: tren:=1: for i from 1 to n do if ( ts_stpf(i) = 2) then ans:=[ op(ans), i ]: tren:=tren+1; fi od; RETURN(ans) end: ts_pr_nd(500);
-
Select[Range[300],Count[IntegerDigits[#],?PrimeQ]==2&] (* _Harvey P. Dale, Apr 20 2025 *)
A092625
Numbers with exactly three prime digits.
Original entry on oeis.org
222, 223, 225, 227, 232, 233, 235, 237, 252, 253, 255, 257, 272, 273, 275, 277, 322, 323, 325, 327, 332, 333, 335, 337, 352, 353, 355, 357, 372, 373, 375, 377, 522, 523, 525, 527, 532, 533, 535, 537, 552, 553, 555, 557, 572, 573, 575, 577, 722, 723, 725
Offset: 1
222 has three prime digits, three times 2;
1235 has three prime digits, 2, 3 and 5.
-
import Data.List (elemIndices)
a092625 n = a092625_list !! (n-1)
a092625_list = elemIndices 3 a193238_list
-- Reinhard Zumkeller, Jul 19 2011
-
stev_sez:=proc(n) local i, tren, st, ans, anstren; ans:=[ ]: anstren:=[ ]: tren:=n: for i while (tren>0) do st:=round( 10*frac(tren/10) ): ans:=[ op(ans), st ]: tren:=trunc(tren/10): end do; for i from nops(ans) to 1 by -1 do anstren:=[ op(anstren), op(i,ans) ]; od; RETURN(anstren); end: ts_stpf:=proc(n) local i, stpf, ans; ans:=stev_sez(n): stpf:=0: for i from 1 to nops(ans) do if (isprime(op(i,ans))='true') then stpf:=stpf+1; # number of prime digits fi od; RETURN(stpf) end: ts_pr_nt:=proc(n) local i, stpf, ans, ans1, tren; ans:=[ ]: stpf:=0: tren:=1: for i from 1 to n do if ( ts_stpf(i) = 3) then ans:=[ op(ans), i ]: tren:=tren+1; fi od; RETURN(ans) end: ts_pr_nt(2000);
-
Select[Range[800],Total[Boole[PrimeQ[IntegerDigits[#]]]]==3&] (* Harvey P. Dale, Dec 31 2023 *)
A108419
Primes with at least one of each prime digit.
Original entry on oeis.org
2357, 2753, 3257, 3527, 5237, 5273, 7253, 7523, 22573, 23357, 23537, 23557, 23753, 25237, 25357, 25373, 25537, 25733, 27253, 32257, 32537, 32573, 35227, 35257, 35327, 35527, 37253, 52237, 52733, 53327, 53527, 57223, 72253, 72353, 72533, 73523, 75223, 75253
Offset: 1
Cf.
A019546 (primes whose digits are primes).
-
Select[Table[Prime[n],{n,7200}],ContainsExactly[IntegerDigits[#],{2,3,5,7}]&] (* James C. McMahon, Mar 05 2024 *)
-
from sympy import isprime
from itertools import count, islice, product
def agen(): yield from (t for d in count(4) for b in product("2357", repeat=d-1) for e in "37" if len(set(b+(e,)))==4 and isprime(t:=int("".join(b)+e)))
print(list(islice(agen(), 40))) # Michael S. Branicky, Mar 05 2024
A124674
Primes with distinct prime digits.
Original entry on oeis.org
2, 3, 5, 7, 23, 37, 53, 73, 257, 523, 2357, 2753, 3257, 3527, 5237, 5273, 7253, 7523
Offset: 1
- Caldwell and Honaker, 2357, Prime Curios!
-
Select[Range[10000], PrimeQ[ # ] && Length[IntegerDigits[ # ]] == Length[Union[IntegerDigits[ # ]]] && Complement[IntegerDigits[ # ], {2, 3, 5, 7}] == {} &]
-
is(k) = isprime(k) && setintersect([2, 3, 5, 7], v=vecsort(digits(k))) == v; \\ Jinyuan Wang, Mar 27 2020
Comments