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.

Showing 1-5 of 5 results.

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

Original entry on oeis.org

1, 1, 2, 3, 5, 5, 16, 21, 48, 69, 175, 229, 529, 768, 1850, 2860, 6276, 10252, 23248, 36563, 81622, 133739, 300311, 491193, 1091809, 1816561, 4062176, 6772098, 15021634, 25284670, 56134342, 94895078, 209889612
Offset: 1

Views

Author

Antti Karttunen, Jun 04 2004

Keywords

Comments

Ratios a(n)/A036378(n) converge as: 1, 0.5, 1, 0.6, 0.714286, 0.384615, 0.695652, 0.488372, 0.64, 0.50365, 0.686275, 0.493534, 0.606651, 0.476427, 0.610561, 0.500963, 0.583868, 0.502795, 0.601734, 0.496874, 0.581618, 0.498624, 0.584595, 0.498259, 0.57642, 0.498269, 0.578057, 0.499347, 0.573186, 0.498736, 0.571734, 0.498567, 0.568309
Ratios a(n)/A095335(n) converge as: 1, 1, 1, 1.5, 1.25, 0.625, 0.842105, 0.954545, 1.116279, 1.014706, 1.100629, 0.974468, 0.985102, 0.909953, 0.966562, 1.003861, 0.984008, 1.011245, 1.00445, 0.987575, 0.991822, 0.994512, 0.988408, 0.993061, 0.99389, 0.9931, 0.99673, 0.997392, 0.997286, 0.994955, 0.995265, 0.994285, 0.996248

Crossrefs

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

A095314 Primes in whose binary expansion the number of 1 bits is > 2 + number of 0 bits.

Original entry on oeis.org

7, 23, 29, 31, 47, 59, 61, 79, 103, 107, 109, 127, 191, 223, 239, 251, 311, 317, 347, 349, 359, 367, 373, 379, 383, 431, 439, 443, 461, 463, 467, 479, 487, 491, 499, 503, 509, 607, 631, 701, 719, 727, 733, 743, 751, 757, 761, 823, 827, 829, 859
Offset: 1

Views

Author

Antti Karttunen, Jun 04 2004

Keywords

Crossrefs

Complement of A095315 in A000040. Subset of A095286. Subset: A095318. Cf. also A095334.

Programs

  • Maple
    f:= proc(n) local L,d,s;
        if not isprime(n) then return false fi;
        L:= convert(n,base,2);
        convert(L,`+`) > nops(L)/2+1
    end proc:
    select(f, [seq(i,i=3..1000,2)]); # Robert Israel, Oct 26 2023
  • Mathematica
    n1Q[p_]:=Module[{be=IntegerDigits[p,2]},Total[be]>2+Count[be,0]]; Select[ Prime[ Range[150]],n1Q] (* Harvey P. Dale, Oct 26 2022 *)
  • 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 > (2+b0), return(1);, return(0););};
    forprime(x = 2, 859, if(B(x), print1(x, ", "); ); );
    \\ Washington Bomfim, Jan 12 2011

A095284 Primes in whose binary expansion the number of 1 bits is > 5 + number of 0 bits.

Original entry on oeis.org

127, 191, 223, 239, 251, 383, 479, 503, 509, 751, 863, 887, 983, 991, 1013, 1019, 1021, 1279, 1471, 1531, 1663, 1759, 1783, 1787, 1789, 1951, 1979, 1999, 2011, 2027, 2029, 2039, 2543, 2551, 2557, 2687, 2879, 2927, 2939, 2999, 3023, 3037
Offset: 1

Views

Author

Antti Karttunen, Jun 04 2004

Keywords

Crossrefs

Complement of A095285 in A000040. Subset of A095322. Subset: A095312. Cf. also A095286, A095294.

Programs

  • 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 > (5+b0), return(1);, return(0););};
    forprime(x = 31, 3037, if(B(x), print1(x, ", "); ); );
    \\ Washington Bomfim, Jan 12 2011

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

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 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
Offset: 1

Views

Author

Antti Karttunen, Jun 04 2004

Keywords

Comments

Differs from primes (A000040) first time at n=31, where a(31)=131, while A000040(31)=127, as 127 whose binary expansion is 1111111, with 7 1-bits and no 0-bits is the first prime excluded from this sequence. Note that 63 (111111 in binary) is not prime.

Crossrefs

Complement of A095284 in A000040. Subset: A095323. Subset of A095313, from which it differs first time at n=42, where a(42)=193 (11000001 in binary) while A095313(42)=191 (10111111 in binary). Cf. also A095286, A095295.

Programs

  • 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 <= (5+b0), return(1);, return(0););};
    forprime(x = 2, 283, if(B(x), print1(x, ", "); ); );
    \\ Washington Bomfim, Jan 12 2011

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

Original entry on oeis.org

2, 5, 17, 19, 37, 41, 67, 71, 73, 83, 89, 97, 101, 113, 131, 137, 139, 149, 163, 193, 197, 257, 263, 269, 271, 277, 281, 283, 293, 307, 313, 331, 337, 353, 389, 397, 401, 409, 419, 421, 433, 449, 457, 521, 523, 541, 547, 557, 563, 569, 577, 587, 593, 601, 613
Offset: 1

Views

Author

Antti Karttunen, Jun 04 2004

Keywords

Examples

			From _Indranil Ghosh_, Feb 03 2017: (Start)
5 is in the sequence because 5_10 = 101_2. '101' has two 1's and one 0.
17 is in the sequence because 17_10 = 10001_2. '10001' has two 1's and three 0's. (End)
		

Crossrefs

Complement of A095286 in A000040. Subset: A095075. Subset of A095315. Cf. also A095297.

Programs

  • Mathematica
    Select[Prime[Range[200]],DigitCount[#,2,1]<=1+DigitCount[#,2,0]&] (* Harvey P. Dale, Apr 18 2023 *)
  • PARI
    forprime(p=2,613,v=binary(p);s=0;for(k=1,#v,s+=if(v[k]==1,+1,-1));if(s<=1,print1(p,", "))) \\ Washington Bomfim, Jan 13 2011
    
  • Python
    from sympy import isprime
    i=1
    j=1
    while j<=250:
        if isprime(i) and bin(i)[2:].count("1")<=1+bin(i)[2:].count("0"):
            print(str(j)+" "+str(i))
            j+=1
        i+=1 # Indranil Ghosh, Feb 03 2017
Showing 1-5 of 5 results.