Displaying 1-10 of 73 results found.
Primes whose binary representation is also the decimal representation of a prime.
+10
86
3, 5, 23, 47, 89, 101, 149, 157, 163, 173, 179, 199, 229, 313, 331, 367, 379, 383, 443, 457, 523, 587, 631, 643, 647, 653, 659, 709, 883, 947, 997, 1009, 1091, 1097, 1163, 1259, 1277, 1283, 1289, 1321, 1483, 1601, 1669, 1693, 1709, 1753, 1877, 2063, 2069, 2099
COMMENTS
In general rebase notation (Marc LeBrun): p2 = (2) [p] (10).
EXAMPLE
1009{10} = 1111110001{2} is prime, and 1111110001{10} is also prime.
89 is in the sequence because it is a prime. Binary representation of 89 = 1011001, which is also a prime.
MAPLE
select(t -> isprime(t) and isprime(convert(t, binary)), [seq(2*i+1, i=1..1000)]); # Robert Israel, Jul 08 2014
MATHEMATICA
Select[ Range[1900], PrimeQ[ # ] && PrimeQ[ FromDigits[ IntegerDigits[ #, 2]]] & ]
Select[ Prime@ Range@ 330, PrimeQ[ FromDigits[ IntegerDigits[#, 2]]] &] (* Robert G. Wilson v, Oct 09 2014 *)
PROG
(PARI) {(baseE(x, b)= local(d, e=0, f=1); while (x>0, d=x-b*(x\b); x\=b; e+=d*f; f*=10); e); n=0; for (m=1, 10^9, p=prime(m); b=baseE(p, 2); if (isprime(b), write("b065720.txt", n++, " ", p); if (n==1000, return)) ) } \\ Harry J. Smith, Oct 27 2009
(PARI) isok(p) = isprime(p) && isprime(fromdigits(binary(p), 10)); \\ Michel Marcus, Mar 04 2022
(Python)
from sympy import isprime
def ok(n): return isprime(n) and isprime(int(bin(n)[2:]))
Primes whose decimal representation is a valid number in base 4 and interpreted as such is again a prime.
+10
79
2, 3, 11, 13, 23, 31, 101, 103, 113, 131, 211, 223, 233, 311, 331, 1013, 1021, 1033, 1103, 1201, 1213, 1223, 1231, 1301, 2003, 2111, 2113, 2131, 2203, 2213, 2311, 2333, 3001, 3011, 3203, 3221, 3301, 3323, 10111, 10211, 10303, 10313, 10321, 10331
EXAMPLE
13 is prime in decimal and also when considered as a number in base 4: 13 [base 4] = 7 [base 10] which is also prime.
MATHEMATICA
Select[ FromDigits@# & /@ IntegerDigits[ Prime@ Range@ 270, 4], PrimeQ] (* Robert G. Wilson v, Jan 05 2014 *)
FromDigits[#, 10]&/@Select[Tuples[{0, 1, 2, 3}, 5], AllTrue[{FromDigits[#, 4], FromDigits[#, 10]}, PrimeQ]&] (* Harvey P. Dale, Jul 30 2021 *)
PROG
(PARI) forprime(p=2, 1e4, if(isprime(t=fromdigits(digits(p, 4))), print1(t", "))) \\ Charles R Greathouse IV, Apr 22 2015
EXTENSIONS
Name, example and offset corrected by M. F. Hasler, Jan 03 2014
Primes whose decimal representation also represents a prime in base 3.
+10
73
2, 2111, 2221, 10211, 12011, 12211, 20201, 21011, 21101, 21211, 22111, 101021, 101111, 102101, 102121, 110221, 111121, 111211, 120011, 120121, 121001, 121021, 122011, 201101, 202001, 202021, 210011, 210101, 1000211, 1010201, 1012201
COMMENTS
See A065721 for the primes given by these terms considered as numbers written in base 3, i.e., the sequence with the definition "working in the opposite sense". - M. F. Hasler, Jan 05 2014
EXAMPLE
2111 is a prime and its decimal representation is also a valid base-3 representation (because all digits are < 3), and 2111[3] = 67[10] is again a prime. Therefore 2111 is in the sequence.
MATHEMATICA
Select[ FromDigits@# & /@ IntegerDigits[ Prime@ Range@ 270, 3], PrimeQ] (* Robert G. Wilson v, Jan 05 2014 *)
FromDigits/@Select[Tuples[{0, 1, 2}, 7], AllTrue[{FromDigits[#], FromDigits[ #, 3]}, PrimeQ]&] (* Harvey P. Dale, Aug 15 2022 *)
PROG
(PARI) is_ A089981(p)=vecmax(d=digits(p))<3&&isprime(vector(#d, i, 3^(#d-i))*d~)&&isprime(p) \\ "d" is implicitly declared local. Putting isprime(p) to the end improves performance when the function is applied to primes only, as below, or to very large numbers. - M. F. Hasler, Jan 05 2014
(PARI) fixBase(n, oldBase, newBase)=my(d=digits(n, oldBase), t=newBase-1); for(i=1, #d, if(d[i]>t, for(j=i, #d, d[j]=t); break)); fromdigits(d, newBase)
list(lim)=my(v=List(), t); forprime(p=2, fixBase(lim\1, 10, 3), if(isprime(t=fromdigits(digits(p, 3), 10)), listput(v, t))); Vec(v) \\ Charles R Greathouse IV, Nov 07 2016
EXTENSIONS
Definition and example reworded, offset corrected and cross-references added by M. F. Hasler, Jan 05 2014
Primes whose decimal representation is a valid number in base 8 and interpreted as such is again a prime.
+10
68
2, 3, 5, 7, 13, 23, 37, 53, 73, 103, 107, 131, 211, 227, 263, 277, 307, 337, 373, 401, 431, 433, 463, 467, 521, 541, 547, 557, 577, 631, 643, 661, 673, 701, 1013, 1063, 1151, 1153, 1201, 1223, 1327, 1423, 1451, 1453, 1531, 1567, 1613, 1627, 1663, 1721, 2011, 2017
EXAMPLE
a(5) = 13_10 = prime(5), 13_8 = 3 + 1*8 = 11_10 = prime(4).
a(8) = 53_10 = prime(16), 53_8 = 3 + 5*8 = 43_10 = prime(14). - Marius A. Burtea, Jun 30 2019
MATHEMATICA
Select[FromDigits@# & /@ IntegerDigits[ Prime@ Range@ 270, 8], PrimeQ]
PROG
(PARI) fixBase(n, oldBase, newBase)=my(d=digits(n, oldBase), t=newBase-1); for(i=1, #d, if(d[i]>t, for(j=i, #d, d[j]=t); break)); fromdigits(d, newBase)
list(lim)=my(v=List(), t); forprime(p=2, fixBase(lim\1, 10, 8), if(isprime(t=fromdigits(digits(p, 8), 10)), listput(v, t))); Vec(v) \\ Charles R Greathouse IV, Nov 07 2016
(Magma) [n:n in PrimesUpTo(2100)| Max(Intseq(n, 10)) le 7 and IsPrime(Seqint(Intseq(Seqint(Intseq(n), 8))))]; // Marius A. Burtea, Jun 30 2019
Primes whose decimal representation is a valid number in base 9 and interpreted as such is again a prime.
+10
68
2, 3, 5, 7, 41, 47, 67, 131, 151, 241, 331, 337, 461, 557, 601, 641, 661, 751, 757, 827, 887, 1031, 1181, 1217, 1231, 1321, 1327, 1367, 1471, 1637, 1877, 2027, 2081, 2111, 2131, 2207, 2281, 2287, 2351, 2357, 2647, 2731, 2861, 3037, 3121, 3181, 3187, 3307, 3347
MATHEMATICA
Select[FromDigits@# & /@ IntegerDigits[ Prime@ Range@ 270, 9], PrimeQ]
PROG
(PARI) fixBase(n, oldBase, newBase)=my(d=digits(n, oldBase), t=newBase-1); for(i=1, #d, if(d[i]>t, for(j=i, #d, d[j]=t); break)); fromdigits(d, newBase)
list(lim)=my(v=List(), t); forprime(p=2, fixBase(lim\1, 10, 9), if(isprime(t=fromdigits(digits(p, 9), 10)), listput(v, t))); Vec(v) \\ Charles R Greathouse IV, Nov 07 2016
Primes whose base-3 representation also is the base-2 representation of a prime.
+10
66
3, 13, 31, 37, 271, 283, 733, 757, 769, 1009, 1093, 2281, 2467, 2521, 2551, 2917, 3001, 3037, 3163, 3169, 3187, 3271, 6673, 7321, 7573, 9001, 9103, 9733, 19801, 19963, 20011, 20443, 20521, 20533, 20749, 21871, 21961, 22123, 22639, 22717, 27253, 28711, 28759, 29173, 29191, 59077, 61483, 61507, 61561, 65701, 65881
COMMENTS
This sequence and A235383 and A229037 are winners in the contest held at the 2014 AMS/MAA Joint Mathematics Meetings. - T. D. Noe, Jan 20 2014
This sequence was motivated by work initiated by V.J. Pohjola's post to the SeqFan list, which led to a clarification of the definition and correction of some errors, in sequences A089971, A089981 and A090707 through A090721. These sequences use "rebasing" (terminology of A065361) from some base b to base 10. Sequences A065720 - A065727 follow the same idea but use rebasing in the other sense, from base 10 to base b. The observation that only (10,b) and (b,10) had been considered so far led to the definition of this and related sequences: In a systematic approach, it seems natural to start with the smallest possible pairs of different bases, (2,3) and (3,2), then (2 <-> 4), (3 <-> 4), (2 <-> 5), etc.
Among the two possibilities using the smallest possible bases, 2 and 3, the present one seems a little bit more interesting, among others because not every base-3 representation is a valid base-2 representation (in contrast to the opposite case). This is also a reason why the present sequence grows much faster than the partner sequence A235266.
EXAMPLE
3 = 10_3 and 10_2 = 2 is prime. 13 = 111_3 and 111_2 = 7 is prime.
MAPLE
N:= 1000: # to get the first N terms
count:= 0:
for i from 1 while count < N do
p2:= ithprime(i);
L:= convert(p2, base, 2);
p3:= add(3^(j-1)*L[j], j=1..nops(L));
if isprime(p3) then
count:= count+1;
fi
od:
MATHEMATICA
b32pQ[n_]:=Module[{idn3=IntegerDigits[n, 3]}, Max[idn3]<2&&PrimeQ[ FromDigits[ idn3, 2]]]; Select[Prime[Range[7000]], b32pQ] (* Harvey P. Dale, Apr 24 2015 *)
PROG
(PARI) is(p, b=2, c=3)=vecmax(d=digits(p, c))<b&&isprime(vector(#d, i, b^(#d-i))*d~)&&isprime(p)
(Python)
from sympy import isprime, nextprime
def agen(): # generator of terms
p = 2
while True:
p3 = sum(3**i for i, bi in enumerate(bin(p)[2:][::-1]) if bi=='1')
if isprime(p3):
yield p3
p = nextprime(p)
g = agen()
Primes whose base-4 representation also is the base 2-representation of a prime.
+10
64
5, 17, 257, 277, 337, 1093, 1109, 1297, 1361, 4357, 5189, 16453, 16657, 16661, 17489, 17669, 17681, 17749, 21521, 21569, 21589, 65537, 65557, 65617, 65809, 66821, 70657, 70981, 70997, 81937, 82241, 83221, 83269, 86017, 86357, 87317, 263429, 263489, 267541, 278549
COMMENTS
This sequence is part of the two-dimensional array of sequences based on this same idea for any two different bases b, c > 1. Sequence A235265 and A235266 are the most elementary ones in this list. Sequences A089971, A089981 and A090707 through A090721, and sequences A065720 - A065727, follow the same idea with one base equal to 10.
For further motivation and cross-references, see sequence A235265 which is the main entry for this whole family of sequences.
When the smaller base is b=2 such that only digits 0 and 1 are allowed, these are primes that are the sum of distinct powers of the larger base, here c=4, thus a subsequence of A077718 and therefore also of A000695, the Moser-de Bruijn sequence.
EXAMPLE
5 = 11_4 and 11_2 = 3 are both prime, so 5 is a term.
17 = 101_4 and 101_2 = 5 are both prime, so 17 is a term.
PROG
(PARI) is(p, b=2, c=4)=vecmax(d=digits(p, c))<b&&isprime(vector(#d, i, b^(#d-i))*d~)&&isprime(p)
(Python)
from itertools import islice
from sympy import nextprime, isprime
def A235461_gen(): # generator of terms
p = 1
while (p:=nextprime(p)):
if isprime(m:=int(bin(p)[2:], 4)):
yield m
Primes whose base-5 representation is also the base-9 representation of a prime.
+10
63
2, 3, 7, 11, 17, 19, 37, 41, 61, 67, 71, 97, 109, 131, 139, 149, 151, 157, 167, 191, 197, 211, 251, 269, 281, 337, 349, 367, 401, 409, 439, 449, 457, 467, 487, 491, 499, 521, 557, 569, 607, 619, 631, 647, 661, 739, 761, 769, 821, 829, 887, 907, 941, 947, 967, 1009, 1019, 1031, 1061, 1069, 1087
COMMENTS
This sequence is part of a two-dimensional array of sequences, given in the LINK, based on this same idea for any two different bases b, c > 1. Sequence A235265 and A235266 are the most elementary ones in this list. Sequences A089971, A089981 and A090707 through A090721, and sequences A065720 - A065727, follow the same idea with one base equal to 10.
EXAMPLE
41 = 131_5 and 131_9 = 109 are both prime, so 41 is a term.
MATHEMATICA
Select[Prime@ Range@ 500, PrimeQ@ FromDigits[ IntegerDigits[#, 5], 9] &] (* Giovanni Resta, Sep 12 2019 *)
PROG
(PARI) is(p, b=9, c=5)=isprime(vector(#d=digits(p, c), i, b^(#d-i))*d~)&&isprime(p) \\ Note: Code only valid for b > c.
Primes whose representation in base 1024 can be interpreted as a decimal prime.
+10
56
2, 3, 5, 7, 1031, 1033, 3079, 4099, 6151, 7177, 1048583, 1049603, 1050631, 1051649, 1053697, 1054723, 2099203, 2100227, 2101249, 2102273, 2102279, 2105347, 3148801, 3148807, 3149831, 3150857, 3151879, 3153923, 3153929, 4198409, 4200451, 5242883
PROG
(PARI) is(n)=if(!isprime(n), return(0)); my(s, t, b=1); while(n, t=n%1024; if(t>9, return(0)); s+=t*b; b*=10; n>>=10); s \\ Charles R Greathouse IV, Feb 07 2013
(PARI) v=List(); forprime(p=2, 1e3, d=digits(p); t=sum(i=1, #d, d[i]<<(10*(#d-i))); if(ispseudoprime(t), listput(v, t))); Vec(v) \\ Charles R Greathouse IV, Feb 07 2013
EXTENSIONS
Better definition and offset by Omar E. Pol, Dec 24 2008
Primes whose base-5 representation also is the base-4 representation of a prime.
+10
28
2, 3, 13, 41, 43, 61, 181, 191, 263, 281, 283, 331, 383, 431, 443, 463, 641, 643, 661, 881, 911, 1063, 1091, 1291, 1303, 1531, 1693, 2083, 2143, 2203, 2293, 2341, 3163, 3181, 3191, 3253, 3343, 3593, 3761, 3931, 4001, 4093, 4391, 4691, 4793, 5011, 5393, 5413, 5441, 6301
COMMENTS
This sequence is part of the two-dimensional array of sequences based on this same idea for any two different bases b, c > 1. Sequence A235265 and A235266 are the most elementary ones in this list. Sequences A089971, A089981 and A090707 through A090721, and sequences A065720 - A065727, follow the same idea with one base equal to 10.
EXAMPLE
Both 13 = 23_5 and 23_4 = 11 are prime.
PROG
(PARI) is(p, b=4, c=5)=vecmax(d=digits(p, c))<b&&isprime(vector(#d, i, b^(#d-i))*d~)&&isprime(p)
(PARI) forprime(p=1, 3e3, is(p, 5, 4)&&print1(vector(#d=digits(p, 4), i, 5^(#d-i))*d~, ", ")) \\ To produce the terms, this is more efficient than to select them using straightforwardly is(.)=is(., 4, 5)
CROSSREFS
Cf. A235474, A235265, A235266, A152079, A235461 - A235482, A065720 - A065727, A235394, A235395, A089971 ⊂ A020449, A089981, A090707 - A091924, A235615 - A235639. See the LINK for further cross-references.
Search completed in 0.035 seconds
|