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-4 of 4 results.

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

Original entry on oeis.org

1, 1, 2, 2, 4, 8, 19, 22, 43, 68, 159, 235, 537, 844, 1914, 2849, 6378, 10138, 23145, 37023, 82295, 134477, 303833, 494625, 1098521, 1829183, 4075501, 6789809, 15062515, 25412867, 56401388, 95440507, 210680037
Offset: 1

Views

Author

Antti Karttunen, Jun 04 2004

Keywords

Comments

Ratios a(n)/A036378(n) converge as: 1, 0.5, 1, 0.4, 0.571429, 0.615385, 0.826087, 0.511628, 0.573333, 0.49635, 0.623529, 0.506466, 0.615826, 0.523573, 0.631683, 0.499037, 0.593358, 0.497205, 0.599068, 0.503126, 0.586414, 0.501376, 0.591451, 0.501741, 0.579964, 0.501731, 0.579953, 0.500653, 0.574745, 0.501264, 0.574454, 0.501433, 0.570449
Ratios a(n)/A095296(n) converge as: 1, 1, 1, 0.666667, 0.8,1.6, 1.1875, 1.047619, 0.895833, 0.985507, 0.908571, 1.026201,1.015123, 1.098958, 1.034595, 0.996154, 1.016252, 0.98888, 0.99557,1.012581, 1.008245, 1.005518, 1.011728, 1.006987, 1.006148, 1.006948,1.00328, 1.002615, 1.002721, 1.00507, 1.004757, 1.005748, 1.003766

Crossrefs

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

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

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

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

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 37, 41, 43, 53, 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, 307, 311
Offset: 1

Views

Author

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 5 1-bits and no 0 bits is the first prime excluded from this sequence. - Jun 04 2004

Crossrefs

Complement of A095318 in A000040. Subset of A095323, subset: A095315. A095329.

Programs

  • Mathematica
    Select[Prime[Range[70]],DigitCount[#,2,1]Harvey P. Dale, Feb 22 2020 *)
  • 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 <= (3+b0), return(1);, return(0););};
    forprime(x = 2, 311, if(B(x), print1(x, ", "); ); );
    \\ Washington Bomfim, Jan 12 2011
Showing 1-4 of 4 results.