A262369
A(n,k) is the n-th prime whose decimal expansion begins with the decimal expansion of k; square array A(n,k), n>=1, k>=1, read by antidiagonals.
Original entry on oeis.org
11, 2, 13, 3, 23, 17, 41, 31, 29, 19, 5, 43, 37, 211, 101, 61, 53, 47, 307, 223, 103, 7, 67, 59, 401, 311, 227, 107, 83, 71, 601, 503, 409, 313, 229, 109, 97, 89, 73, 607, 509, 419, 317, 233, 113, 101, 907, 809, 79, 613, 521, 421, 331, 239, 127
Offset: 1
Square array A(n,k) begins:
: 11, 2, 3, 41, 5, 61, 7, 83, ...
: 13, 23, 31, 43, 53, 67, 71, 89, ...
: 17, 29, 37, 47, 59, 601, 73, 809, ...
: 19, 211, 307, 401, 503, 607, 79, 811, ...
: 101, 223, 311, 409, 509, 613, 701, 821, ...
: 103, 227, 313, 419, 521, 617, 709, 823, ...
: 107, 229, 317, 421, 523, 619, 719, 827, ...
: 109, 233, 331, 431, 541, 631, 727, 829, ...
-
u:= (h, t)-> select(isprime, [seq(h*10^t+k, k=0..10^t-1)]):
A:= proc(n, k) local l, p;
l:= proc() [] end; p:= proc() -1 end;
while nops(l(k))
-
u[h_, t_] := Select[Table[h*10^t + k, {k, 0, 10^t - 1}], PrimeQ];
A[n_, k_] := Module[{l, p}, l[] = {}; p[] = -1; While[Length[l[k]] < n, p[k] = p[k]+1; l[k] = Join[l[k], u[k, p[k]]]]; l[k][[n]]];
Table[Table[A[n, 1+d-n], {n, 1, d}], {d, 1, 12}] // Flatten (* Jean-François Alcover, Dec 06 2019, from Maple *)
A080165
Primes having initial digits "10" in binary representation.
Original entry on oeis.org
2, 5, 11, 17, 19, 23, 37, 41, 43, 47, 67, 71, 73, 79, 83, 89, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 521, 523, 541, 547, 557, 563
Offset: 1
A000040(15)=47 -> '101111' therefore 47 is a term.
Primes whose binary expansion begins with binary expansion of 1, 2, 3, 4, 5, 6, 7:
A000040,
A080165,
A080166,
A262286,
A262284,
A262287,
A262285.
-
Select[Prime[Range[1000]], IntegerDigits[#, 2][[;;2]] == {1, 0}&] (* Jean-François Alcover, Oct 25 2021 *)
-
pxnm1(n,p) = { forprime(x=2,n, p1 = x; while(p1>1, if(p1%2==0,p1/=2,p1 = p1*p-1;); if(p1 == 4,break); ); if(p1 == 4,print1(x" ")) ) }
A080166
Primes having initial digits "11" in binary representation.
Original entry on oeis.org
3, 7, 13, 29, 31, 53, 59, 61, 97, 101, 103, 107, 109, 113, 127, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 769, 773, 787, 797, 809, 811, 821
Offset: 1
A000040(16)=53 -> '110101' therefore 53 is a term.
Primes whose binary expansion begins with binary expansion of 1, 2, 3, 4, 5, 6, 7:
A000040,
A080165,
A080166,
A262286,
A262284,
A262287,
A262285.
-
Select[Prime[Range[200]],Take[IntegerDigits[#,2],2]=={1,1}&] (* Harvey P. Dale, Jul 30 2019 *)
-
pxnm1(n,p) = { forprime(x=2,n, p1 = x; while(p1>1, if(p1%2==0,p1/=2,p1 = p1*p-1;); if(p1 == 3,break); ); if(p1 == 3,print1(x" ")) ) }
A262284
Primes whose binary expansion begins 101.
Original entry on oeis.org
5, 11, 23, 41, 43, 47, 83, 89, 163, 167, 173, 179, 181, 191, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399
Offset: 1
Primes whose binary expansion begins with binary expansion of 1, 2, 3, 4, 5, 6, 7:
A000040,
A080165,
A080166,
A262286,
A262284,
A262287,
A262285.
-
lis:=[]; q:=5;
for i from 1 to 10 do for j from 1 to 2^i-1 do
if isprime(q*2^i+j) then lis:=[op(lis),q*2^i+j]; fi; od: od:
lis;
-
Select[Flatten[Table[FromDigits[#,2]&/@(Join[{1,0,1},#]&/@Tuples[{0,1},n]),{n,0,10}]],PrimeQ] (* Harvey P. Dale, Oct 17 2021 *)
A262285
Primes whose binary expansion begins 111.
Original entry on oeis.org
7, 29, 31, 59, 61, 113, 127, 227, 229, 233, 239, 241, 251, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873
Offset: 1
Primes whose binary expansion begins with binary expansion of 1, 2, 3, 4, 5, 6, 7:
A000040,
A080165,
A080166,
A262286,
A262284,
A262287,
A262285.
-
lis:=[]; q:=7;
for i from 1 to 10 do for j from 1 to 2^i-1 do
if isprime(q*2^i+j) then lis:=[op(lis),q*2^i+j]; fi; od: od:
lis;
-
Select[FromDigits[#,2]&/@(Join[{1,1,1},#]&/@Flatten[Table[Tuples[{0,1},n],{n,0,8}],1]),PrimeQ] (* or *) Select[Prime[Range[ 3,350]],Take[ IntegerDigits[ #,2],3]=={1,1,1}&] (* Harvey P. Dale, May 02 2021 *)
A262286
Primes whose binary expansion begins 100.
Original entry on oeis.org
17, 19, 37, 67, 71, 73, 79, 131, 137, 139, 149, 151, 157, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093
Offset: 1
Primes whose binary expansion begins with binary expansion of 1, 2, 3, 4, 5, 6, 7:
A000040,
A080165,
A080166,
A262286,
A262284,
A262287,
A262285.
A262287
Primes whose binary expansion begins 110.
Original entry on oeis.org
13, 53, 97, 101, 103, 107, 109, 193, 197, 199, 211, 223, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627
Offset: 1
Primes whose binary expansion begins with binary expansion of 1, 2, 3, 4, 5, 6, 7:
A000040,
A080165,
A080166,
A262286,
A262284,
A262287,
A262285.
A262350
a(1) = 2. For n>1, let s denote the binary string of a(n-1) with the leftmost 1 and following consecutive 0's removed. Then a(n) is the smallest prime not yet present whose binary representation begins with s.
Original entry on oeis.org
2, 3, 5, 7, 13, 11, 29, 53, 43, 23, 31, 61, 59, 109, 181, 107, 173, 367, 223, 191, 127, 509, 1013, 4013, 3931, 3767, 13757, 11131, 2939, 1783, 3037, 1979, 3821, 3547, 1499, 1901, 877, 2927, 1759, 1471, 1789, 1531, 2029, 2011, 7901, 60887, 56239, 93887, 28351
Offset: 1
: 10 ... 2
: 11 ... 3
: 101 ... 5
: 111 ... 7
: 1101 ... 13
: 1011 ... 11
: 11101 ... 29
: 110101 ... 53
: 101011 ... 43
: 10111 ... 23
: 11111 ... 31
: 111101 ... 61
: 111011 ... 59
: 1101101 ... 109
: 10110101 ... 181
: 1101011 ... 107
: 10101101 ... 173
Primes whose binary expansion begins with binary expansion of 1, 2, 3, 4, 5, 6, 7:
A000040,
A080165,
A080166,
A262286,
A262284,
A262287,
A262285.
-
b:= proc() true end:
a:= proc(n) option remember; local h, k, ok, p, t;
if n=1 then p:=2
else h:= (k-> irem(k, 2^(ilog2(k))))(a(n-1)); p:= h;
ok:= isprime(p) and b(p);
for t while not ok do
for k to 2^t-1 while not ok do p:= h*2^t+k;
ok:= isprime(p) and b(p)
od
od
fi; b(p):= false; p
end:
seq(a(n), n=1..70);
A164022
a(n) = the smallest prime that, when written in binary, starts with the substring of n in binary.
Original entry on oeis.org
2, 2, 3, 17, 5, 13, 7, 17, 19, 41, 11, 97, 13, 29, 31, 67, 17, 37, 19, 41, 43, 89, 23, 97, 101, 53, 109, 113, 29, 61, 31, 131, 67, 137, 71, 73, 37, 307, 79, 163, 41, 337, 43, 89, 181, 373, 47, 97, 197, 101, 103, 211, 53, 109, 223, 113, 229, 233, 59, 241, 61, 251, 127, 257
Offset: 1
4 in binary is 100. Looking at the binary numbers that begin with 100: 100 = 4 in decimal is composite; 1000 = 8 in decimal is composite; 1001 = 9 in decimal is composite; 10000 = 16 in decimal is composite. But 10001 = 17 in decimal is prime. So a(4) = 17.
-
A164022 := proc(n) dgs2 := convert(n,base,2) ; ldgs := nops(dgs2) ; for i from 1 do p := ithprime(i) ; if p >= n then pdgs := convert(p,base,2) ; if [op(nops(pdgs)+1-ldgs.. nops(pdgs),pdgs)] = dgs2 then RETURN( p) ; fi; fi; od: end: seq(A164022(n),n=1..120) ; # R. J. Mathar, Sep 13 2009
-
With[{s = Map[IntegerDigits[#, 2] &, Prime@ Range[10^4]]}, Table[Block[{d = IntegerDigits[n, 2]}, FromDigits[#, 2] &@ SelectFirst[s, Take[#, UpTo@ Length@ d] == d &]], {n, 64}]] (* Michael De Vlieger, Sep 23 2017 *)
Corrected terms a(1) and a(2) (with help from Ray Chandler)
Leroy Quet, Aug 16 2009
A262366
a(n) is the n-th prime whose binary expansion begins with the binary expansion of n.
Original entry on oeis.org
2, 5, 13, 67, 43, 107, 127, 263, 307, 349, 373, 773, 839, 907, 991, 1063, 1109, 1201, 1277, 1321, 2713, 2819, 2963, 3119, 3229, 3371, 3517, 3691, 3779, 3943, 4051, 4217, 8461, 8719, 8963, 9241, 9497, 9767, 10039, 10303, 10613, 10799, 11159, 11317, 11657, 11923
Offset: 1
-
u:= (h, t)-> select(isprime, [seq(h*2^t+k, k=0..2^t-1)]):
A:= proc(n, k) local l, p;
l:= proc() [] end; p:= proc() -1 end;
while nops(l(k)) A(n$2):
seq(a(n), n=1..60);
Showing 1-10 of 10 results.
Comments