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.

Previous Showing 71-80 of 143 results. Next

A095321 Primes in whose binary expansion the number of 1-bits is <= number of 0-bits minus 3.

Original entry on oeis.org

257, 521, 577, 641, 769, 1031, 1033, 1049, 1061, 1091, 1093, 1097, 1153, 1217, 1283, 1289, 1297, 1409, 1553, 1601, 2053, 2069, 2081, 2083, 2089, 2113, 2129, 2179, 2309, 2593, 2689, 3089, 3137, 3329, 4099, 4111, 4129, 4133, 4139, 4153
Offset: 1

Views

Author

Antti Karttunen, Jun 04 2004

Keywords

Crossrefs

Complement of A095320 in A000040. Subset of A095317. Cf. also A095331.

Programs

  • Maple
    filter:= proc(p) local L;
      L:= convert(p,base,2);
      2*convert(L,`+`) <= nops(L)-3
    end proc;
    select(filter, [seq(ithprime(i),i=1..1000)]); # Robert Israel, Apr 27 2025
  • Mathematica
    Select[Prime[Range[600]],DigitCount[#,2,1]<=DigitCount[#,2,0]-3&] (* Harvey P. Dale, Jul 04 2018 *)
  • PARI
    forprime(p=2, 4200, v=binary(p); s=0; for(k=1,#v, s+=if(v[k]==1,+1,-1)); if(s<=-3, print1(p,", "))) \\ Washington Bomfim, Jan 12 2011

A095322 Primes in whose binary expansion the number of 1 bits is > 4 + number of 0 bits.

Original entry on oeis.org

31, 127, 191, 223, 239, 251, 367, 379, 383, 431, 439, 443, 463, 479, 487, 491, 499, 503, 509, 751, 863, 887, 983, 991, 1013, 1019, 1021, 1151, 1277, 1279, 1399, 1439, 1471, 1487, 1499, 1511, 1523, 1531, 1663, 1723, 1759, 1783, 1787, 1789, 1823
Offset: 1

Views

Author

Antti Karttunen, Jun 04 2004

Keywords

Crossrefs

Complement of A095323 in A000040. Subset of A095318. Subset: A095284. Cf. also A095324.

Programs

  • Mathematica
    btsQ[n_]:=Module[{idn2=IntegerDigits[n,2]},Count[idn2,1]>4+Count[ idn2,0]]; Select[Prime[Range[300]],btsQ] (* Harvey P. Dale, Nov 12 2011 *)
  • PARI
    B(x) = { nB = floor(log(x)/log(2)); b1 = 0; b0 = 0;
    for(i = 0, nB, if(bittest(x,i), b1++;, b0++;); );
    if(b1 > (4+b0), return(1);, return(0););};
    forprime(x = 2, 1823, if(B(x), print1(x, ", "); ); ); \\ Washington Bomfim, Jan 12 2011

A095323 Primes in whose binary expansion the number of 1 bits is <= 4 + number of 0 bits.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 193, 197, 199, 211, 227, 229, 233, 241, 257, 263, 269, 271, 277, 281, 283, 293
Offset: 1

Views

Author

Antti Karttunen, Jun 04 2004

Keywords

Comments

Differs from primes (A000040) first time at n=11, where a(11)=37, while A000040(11)=31, as 31 whose binary expansion is 11111, with five 1 bits and no 0 bits is the first prime excluded from this sequence. Note that 15 (1111 in binary) is not prime.

Crossrefs

Complement of A095322 in A000040. Subset of A095285. subset: A095319. Cf. A095325.

Programs

  • Mathematica
    Select[Prime[Range[100]],DigitCount[#,2,1]<(5+DigitCount[#,2,0])&] (* Harvey P. Dale, Dec 09 2015 *)
  • PARI
    B(x) = { nB = floor(log(x)/log(2)); b1 = 0; b0 = 0;
    for(i = 0, nB, if(bittest(x,i), b1++;, b0++;); );
    if(b1 <= (4+b0), return(1);, return(0););};
    forprime(x = 2, 293, if(B(x), print1(x, ", "); ); ); \\ Washington Bomfim, Jan 12 2011

A095334 Number of A095314-primes in range ]2^n,2^(n+1)].

Original entry on oeis.org

0, 1, 0, 3, 3, 5, 4, 21, 32, 69, 96, 229, 335, 768, 1116, 2860, 4371, 10252, 15490, 36563, 58041, 133739, 209875, 491193, 795599, 1816561, 2951789, 6772098, 11144763, 25284670, 41781268, 94895078, 158643268
Offset: 1

Views

Author

Antti Karttunen, Jun 04 2004

Keywords

Comments

Ratios a(n)/A036378(n) converge as: 0, 0.5, 0, 0.6, 0.428571, 0.384615, 0.173913, 0.488372, 0.426667, 0.50365, 0.376471, 0.493534, 0.384174, 0.476427, 0.368317, 0.500963, 0.406642, 0.502795, 0.400932, 0.496874, 0.413586, 0.498624, 0.408549, 0.498259, 0.420036, 0.498269, 0.420047, 0.499347, 0.425255, 0.498736, 0.425546, 0.498567, 0.429551
Ratios a(n)/A095297(n) converge as: 1, 1, 1, 1.5, 1.5, 0.625, 0.571429, 0.954545, 1.185185, 1.014706, 1.2, 0.974468, 0.976676, 0.909953, 0.945763, 1.003861, 0.977197, 1.011245, 1.006694, 0.987575, 0.988538, 0.994512, 0.983496, 0.993061, 0.991634, 0.9931, 0.995506, 0.997392, 0.996345, 0.994955, 0.993649, 0.994285, 0.995042

Crossrefs

a(n) = A036378(n)-A095335(n). Cf. A095298.

A095742 Sum of A037888(p) for all primes p such that 2^n < p < 2^(n+1).

Original entry on oeis.org

0, 0, 2, 3, 9, 16, 35, 69, 148, 271, 628, 1167, 2629, 4830, 10597, 20083, 42928, 81579, 174223, 331314, 701382, 1340756, 2825575, 5422454, 11361615, 21873923, 45673361, 88161666, 183458213, 354899159, 736343490, 1427495050, 2954560104
Offset: 1

Views

Author

Antti Karttunen, Jun 12 2004

Keywords

Comments

Ratio a(n)/A036378(n) gives the average asymmetricity ratio for n-bit primes: 0, 0, 1, 0.6, 1.285714, 1.230769, 1.521739, 1.604651, 1.973333, 1.978102, 2.462745, 2.515086, 3.014908, 2.996278, 3.49736, 3.517779, 3.993674, 4.000932, 4.50946, 4.502405, 4.997877, 4.998792, 5.500352, 5.500462, 5.998361, 5.999852, 6.499427, 6.500684, 7.000277, 7.000323, 7.499731, 7.499885, 7.999929, etc. I.e. 2- and 3-bit odd primes are all palindromes, 4-bit primes need on average just a one-bit flip to become palindromes, etc.
Ratio (a(n)/A036378(n))/f(n), where f(n) is (n-1)/4 if n is odd and (n-2)/4 if n is even (i.e. it gives the expected asymmetricity for all odd numbers in range [2^n,2^(n+1)]) converges as follows: 1, 1, 2, 1.2, 1.285714, 1.230769, 1.014493, 1.069767, 0.986667, 0.989051, 0.985098, 1.006034, 1.004969, 0.998759, 0.999246, 1.00508, 0.998418, 1.000233, 1.002102, 1.000535, 0.999575, 0.999758, 1.000064, 1.000084, 0.999727, 0.999975, 0.999912, 1.000105, 1.00004, 1.000046, 0.999964, 0.999985, 0.999991, ...

Examples

			a(1)=0, as only prime in range ]2,4] is 3, which has palindromic binary expansion 11, i.e. A037888(3)=0. a(2)=0, as in range ]4,8] there are two primes 5 (101 in binary) and 7 (111 in binary) so A037888(5) + A037888(7) = 0. a(3)=2, as in range ]8,16] there are two primes, 11 (1011 in binary) and 13 (1101 in binary), thus A037888(11) + A037888(13) = 1+1 = 2.
		

Crossrefs

Cf. A095298, A095732 (sums of similar asymmetricity measures for Zeckendorf-expansion), A095753.

A095743 Primes p for which A037888(p) = 1, i.e., primes whose binary expansion is almost symmetric, needing just a one-bit flip to become palindrome.

Original entry on oeis.org

2, 11, 13, 19, 23, 29, 37, 41, 47, 59, 61, 67, 89, 97, 103, 131, 137, 157, 167, 173, 181, 191, 193, 199, 211, 223, 227, 229, 239, 251, 277, 281, 317, 337, 349, 367, 373, 383, 401, 419, 431, 463, 467, 479, 487, 491, 503, 509, 521, 563, 569, 577
Offset: 1

Views

Author

Antti Karttunen, Jun 12 2004

Keywords

Crossrefs

The second row of array A095749. Cf. A095753, A095748.

Programs

  • Maple
    f:= proc(n) local L,i;
      L:= convert(n,base,2);
      add(abs(L[i]-L[-i]),i=1..floor(nops(L)/2))
    end proc:
    select(t -> f(t) = 1, [seq(ithprime(i),i=1..1000)]); # Robert Israel, Dec 04 2023

A095748 Almost maximally asymmetric primes in binary.

Original entry on oeis.org

17, 31, 37, 41, 47, 59, 61, 67, 89, 97, 103, 139, 149, 163, 197, 263, 269, 283, 293, 307, 353, 359, 379, 389, 409, 433, 439, 449, 461, 499, 541, 557, 607, 613, 631, 659, 727, 743, 809, 829, 877, 929, 941, 953, 997, 1009, 1039, 1051, 1151, 1171
Offset: 1

Views

Author

Antti Karttunen, Jun 12 2004

Keywords

Comments

Primes p for which A037888(p) = floor((A070939(p)-4)/2). Those numbers contain just two bits mirroring each other, beyond the first and last bits. (All the odd primes without leading zeros begin and end in 1 bits.)

Examples

			a(5)=(101111)2. In this case, from left to right, the third bit agrees with the fourth. The prime 53 = (110101)_2 is not a term since the symmetry is limited to the first and last bits.
		

Crossrefs

Programs

  • PARI
    A070939(p) = { return(floor(log(p)/log(2))+1) };
    A037888(p)={v=binary(p);s=0;j=#v;for(k=1,#v,s+=abs(v[k]- v[j]);j--);return(s/2);}; forprime(p=3,1171,if(A037888(p)==floor((A070939(p)-4)/2), print1(p,", ")))

Extensions

Edited by Washington Bomfim, Jan 13 2011

A095753 Number of almost base-2 palindromic primes (A095743) in range ]2^n,2^(n+1)].

Original entry on oeis.org

0, 0, 2, 3, 5, 4, 15, 18, 32, 33, 63, 81, 119, 144, 256, 318, 527, 640, 1029, 1281, 2236, 2566, 4273, 5410, 8261, 10610, 16868, 21084, 33943, 43104, 68218, 88493, 136343
Offset: 1

Views

Author

Antti Karttunen, Jun 12 2004

Keywords

Comments

Ratio a(n)/A036378(n) converges as follows: 0, 0, 1, 0.6, 0.714286, 0.307692, 0.652174, 0.418605, 0.426667, 0.240876, 0.247059, 0.174569, 0.136468, 0.08933, 0.084488, 0.055702, 0.049028, 0.031388, 0.026634, 0.017408, 0.015933, 0.009567, 0.008318, 0.005488, 0.004361, 0.00291, 0.0024, 0.001555, 0.001295, 0.00085, 0.000695, 0.000465, 0.000369
Ratio a(n)/A095758(n) converges as follows: 1, 1, 0, 1.5, 1, 1, 3.75, 1.2, 2, 1.375, 1.909091, 1.446429, 1.652778, 1.515789, 1.718121, 1.452055, 1.636646, 1.191806, 1.570992, 1.283567, 1.708174, 1.380312, 1.534842, 1.392177, 1.547004, 1.311334, 1.573801, 1.302205, 1.521016, 1.419202, 1.570938, 1.389237, 1.546084

Crossrefs

The second diagonal of triangle A095759. Cf. A095742.

A095757 Number of A095747-primes in range ]2^n,2^(n+1)].

Original entry on oeis.org

1, 2, 2, 3, 2, 6, 4, 7, 7, 10, 9, 26, 20, 43, 27, 74, 41, 112, 93, 181, 167, 495, 274, 796, 558, 1232, 935, 2602, 1512, 5164, 3275, 8689, 6309
Offset: 1

Views

Author

Antti Karttunen, Jun 12 2004

Keywords

Comments

Ratio a(n)/A036378(n) converges as follows: 1, 1, 1, 0.6, 0.285714, 0.461538, 0.173913, 0.162791, 0.093333, 0.072993, 0.035294, 0.056034, 0.022936, 0.026675, 0.008911, 0.012962, 0.003814, 0.005493, 0.002407, 0.00246, 0.00119, 0.001846, 0.000533, 0.000807, 0.000295, 0.000338, 0.000133, 0.000192, 0.000058, 0.000102, 0.000033, 0.000046, 0.000017

Crossrefs

The last nonzero terms from each row of triangle A095759. Bisection: A095760.

A095766 Number of primes whose binary expansion begins '11' (A080166) in range ]2^n,2^(n+1)].

Original entry on oeis.org

1, 1, 1, 2, 3, 7, 11, 21, 37, 67, 125, 227, 431, 787, 1491, 2812, 5296, 10055, 19079, 36343, 69398, 132661, 254122, 488028, 937994, 1806147, 3482463, 6722625, 12994889, 25145151, 48709705, 94451647, 183312229, 356089665, 692285717
Offset: 1

Views

Author

Antti Karttunen, Jun 12 2004

Keywords

Comments

I.e. number of primes p such that (2^n + 2^(n-1)) < p < 2^(n+1).
Ratio a(n)/A036378(n) converges as follows: 1, 0.5, 0.5, 0.4, 0.428571, 0.538462, 0.478261, 0.488372, 0.493333, 0.489051, 0.490196, 0.489224, 0.494266, 0.488213, 0.492079, 0.492556, 0.492697, 0.493134, 0.493827, 0.493885, 0.494513, 0.494605, 0.494682, 0.495049, 0.495214, 0.495412, 0.495563, 0.495699, 0.49585, 0.495984, 0.496113, 0.496237, 0.496346

Crossrefs

a(n) = A036378(n)-A095765(n).

Programs

Extensions

a(34) and a(35) from Robert G. Wilson v, Jan 24 2006
Previous Showing 71-80 of 143 results. Next