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 11-20 of 143 results. Next

A095006 Number of evil primes (A027699) in range ]2^n,2^(n+1)].

Original entry on oeis.org

1, 1, 0, 3, 2, 5, 4, 23, 27, 62, 95, 222, 367, 777, 1269, 2910, 4859, 10140, 17714, 36714, 66020, 133400, 245959, 493532, 916913, 1822087, 3428633, 6782008, 12870735, 25339113, 48419194, 95194890, 182818705, 358637144, 691891351, 1355985684, 2625053871, 5142673207
Offset: 1

Views

Author

Antti Karttunen and Labos Elemer, Jun 01 2004

Keywords

Examples

			From _Michael De Vlieger_, Feb 27 2017: (Start)
a(2) = 1 since between 2^2 and 2^3 only the prime 5 (binary 11) has an even number of 1s.
a(3) = 0 since none of the primes between 2^3 and 2^4 have an even number of 1s in their binary expansions.
a(4) = 3 since the primes 17, 23, and 29 have an even number of 1s in their binary expansions (i.e., 10001, 10111, 11101). (End)
		

Crossrefs

Programs

  • Mathematica
    Table[m = Count[Prime@ Range[PrimePi[2^n] + 1, PrimePi[2^(n + 1) - 1]], k_ /; EvenQ@ DigitCount[k, 2, 1]]; Print@ m; m, {n, 24}] (* Michael De Vlieger, Feb 27 2017 *)

Formula

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

Extensions

a(34)-a(38) from Amiram Eldar, Jun 20 2024

A095056 Number of primes with three 1-bits (A081091) in range [2^n,2^(n+1)].

Original entry on oeis.org

0, 1, 2, 1, 2, 3, 3, 0, 4, 2, 3, 2, 2, 2, 4, 1, 3, 4, 5, 3, 2, 1, 5, 1, 0, 2, 5, 2, 2, 8, 6, 0, 5, 3, 4, 2, 3, 2, 2, 0, 3, 5, 0, 1, 5, 3, 7, 0, 1, 2, 5, 1, 5, 2, 6, 0, 6, 0, 2, 3, 2, 1, 2, 0, 2, 3, 5, 3, 6, 2, 2, 2, 5, 2, 7, 1, 3, 2, 3, 1, 6, 2, 4, 3, 3, 2, 6, 1, 1, 5, 7, 2, 4, 2, 5, 0, 3, 4, 3, 1, 2, 1, 3, 0, 5
Offset: 1

Views

Author

Antti Karttunen and Labos Elemer, Jun 01 2004

Keywords

Examples

			From _Michael De Vlieger_, Feb 27 2017: (Start)
a(1) = 0 because there are no primes with three 1s in binary expansion between 2^1 and 2^2.
a(2) = 1 since the only prime between 2^2 and 2^3 with three 1s in binary expansion is 7 = binary 111.
a(3) = 2 since between 2^3 and 2^4 we have 11 and 13 (binary 1011 and 1101, respectively) have three 1s.
(End)
		

Crossrefs

Programs

  • Mathematica
    Table[m = Count[Prime@ Range[PrimePi[2^n] + 1, PrimePi[2^(n + 1) - 1]], k_ /; DigitCount[k, 2, 1] == 3]; Print@ m; m, {n, 24}] (* Michael De Vlieger, Feb 27 2017 *)

Extensions

More terms from T. D. Noe, Oct 17 2007

A095058 Number of primes with a single 0-bit (A095078) in range ]2^n,2^(n+1)].

Original entry on oeis.org

0, 1, 2, 2, 3, 0, 4, 4, 3, 1, 5, 1, 4, 0, 3, 2, 8, 1, 11, 4, 5, 0, 7, 1, 2, 0, 1, 5, 4, 0, 7, 5, 1, 1, 9, 0, 6, 0, 7, 1, 6, 0, 4, 7, 2, 1, 10, 3, 3, 1, 2, 1, 6, 0, 4, 3, 0, 1, 8, 3, 3, 0, 3, 1, 8, 1, 2, 2, 3, 0, 9, 1, 5, 2, 5, 8, 3, 0, 10, 3, 0, 2, 4, 4, 6, 1
Offset: 1

Views

Author

Antti Karttunen, Jun 01 2004

Keywords

Comments

For large n, the average value of a(n) is about 4. See A138290 for the n such that a(n)=0. - T. D. Noe, Mar 14 2008

Crossrefs

Cf. A095018.

Programs

  • PARI
    a(n) = sum(k=2^n+1, 2^(n+1), isprime(k) && (#select(x->x==0, binary(k))==1)); \\ Michel Marcus, Sep 11 2015

A095060 Number of fibeven primes (A095080) in range ]2^n,2^(n+1)].

Original entry on oeis.org

1, 2, 2, 3, 3, 9, 16, 25, 50, 83, 150, 286, 540, 975, 1865, 3515, 6588, 12620, 23835, 45486, 86811, 165822, 317770, 608517, 1170182, 2254124, 4342530, 8383468, 16197159, 31335332, 60680818, 117633364, 228260489, 443281943, 861677274
Offset: 1

Views

Author

Antti Karttunen, Jun 01 2004

Keywords

Crossrefs

Formula

a(n) = A036378(n) - A095061(n) = A095062(n) + A095067(n).

Extensions

a(34)-a(35) from Amiram Eldar, Jun 13 2024

A095061 Number of fibodd primes (A095081) in range [2^n,2^(n+1)].

Original entry on oeis.org

0, 0, 0, 2, 4, 4, 7, 18, 25, 54, 105, 178, 332, 637, 1165, 2194, 4161, 7770, 14800, 28100, 53525, 102394, 195938, 377301, 723938, 1391620, 2684760, 5178439, 10010119, 19362205, 37501838, 72702221, 141062816, 273985225, 532514962
Offset: 1

Views

Author

Antti Karttunen, Jun 01 2004

Keywords

Crossrefs

Formula

a(n) = A036378(n) - A095060(n) = A095066(n) + A095069(n).

Extensions

a(34)-a(35) from Amiram Eldar, Jun 13 2024

A095073 Primes in whose binary expansion the number of 1-bits is one more than the number of 0-bits.

Original entry on oeis.org

5, 19, 71, 83, 89, 101, 113, 271, 283, 307, 313, 331, 397, 409, 419, 421, 433, 457, 1103, 1117, 1181, 1223, 1229, 1237, 1303, 1307, 1319, 1381, 1427, 1429, 1433, 1481, 1489, 1559, 1579, 1607, 1613, 1619, 1621, 1637, 1699, 1733, 1811, 1861
Offset: 1

Views

Author

Antti Karttunen, Jun 01 2004

Keywords

Examples

			71 is in the sequence because 71_10 = 1000111_2. '1000111' has four 1's and three 0's. - _Indranil Ghosh_, Feb 03 2017
		

Crossrefs

Intersection of A000040 and A031448. Subset of A095070. Cf. A095053.

Programs

  • Mathematica
    Select[Prime[Range[500]], Differences[DigitCount[#, 2]] == {-1} &]
  • PARI
    { forprime(p=2, 2000,
      v=binary(p); s=0;
      for(k=1,#v, s+=if(v[k]==1,+1,-1));
      if(s==1,print1(p,", "))
    ) }
    
  • Python
    from sympy import isprime
    i=1
    j=1
    while j<=25000:
        if isprime(i) and bin(i)[2:].count("1")-bin(i)[2:].count("0")==1:
            print(str(j)+" "+str(i))
            j+=1
        i+=1 # Indranil Ghosh, Feb 03 2017

A095074 Primes in whose binary expansion the number of 0-bits is less than or equal to number of 1-bits.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 71, 79, 83, 89, 101, 103, 107, 109, 113, 127, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 271, 283, 307, 311, 313, 317, 331, 347, 349, 359
Offset: 1

Views

Author

Antti Karttunen, Jun 01 2004

Keywords

Examples

			From _Indranil Ghosh_, Feb 03 2017: (Start)
29 is in the sequence because 29_10 = 11101_2. '11101' has one 0 and three 1's.
37 is in the sequence because 37_10 = 100101_2. '100101' has three 1's and 3 0's. (End)
		

Crossrefs

Complement of A095071 in A000040. Differs from A057447 first time at n=18, where a(n)=71, while A057447(18)=67. Cf. A095054.

Programs

  • Mathematica
    Select[Prime[Range[50]], DigitCount[#, 2, 0] <= DigitCount[#, 2, 1] &] (* Alonso del Arte, Jan 11 2011 *)
  • PARI
    forprime(p=2,359,v=binary(p);s=0;for(k=1,#v,s+=if(v[k]==0,+1,-1));if(s<=0,print1(p,", "))) \\ Washington Bomfim, Jan 13 2011
    
  • Python
    from sympy import isprime
    i=1
    j=1
    while j<=25000:
        if isprime(i) and bin(i)[2:].count("0")<=bin(i)[2:].count("1"):
            print(str(j)+" "+str(i))
            j+=1
        i+=1 # Indranil Ghosh, Feb 03 2017

A095077 Primes with four 1-bits in their binary expansion.

Original entry on oeis.org

23, 29, 43, 53, 71, 83, 89, 101, 113, 139, 149, 163, 197, 263, 269, 277, 281, 293, 337, 353, 389, 401, 449, 523, 547, 593, 643, 673, 773, 1031, 1049, 1061, 1091, 1093, 1097, 1217, 1283, 1289, 1297, 1409, 1553, 1601, 2069, 2083, 2089, 2129
Offset: 1

Views

Author

Antti Karttunen, Jun 01 2004

Keywords

Crossrefs

Subsequence of A027699. First differs from A085448 at n = 19, where a(n)=337, while A085448 continues from there with 311, whose binary expansion has six 1-bits, not four. Cf. A095057.
Cf. A000215 (primes having two bits set), A081091 (three bits set).
Cf. A264908.

Programs

  • Mathematica
    Select[Prime[Range[320]], Plus@@IntegerDigits[#, 2] == 4 &] (* Alonso del Arte, Jan 11 2011 *)
    Select[ Flatten[ Table[2^i + 2^j + 2^k + 1, {i, 3, 11}, {j, 2, i - 1}, {k, j - 1}]], PrimeQ] (* Robert G. Wilson v, Jul 30 2016 *)
  • PARI
    bits1_4(x) = { nB = floor(log(x)/log(2)); z = 0;
    for(i=0,nB,if(bittest(x,i),z++;if(z>4,return(0););););
    if(z == 4, return(1);, return(0););};
    forprime(x=17,2129,if(bits1_4(x),print1(x, ", ");););
    \\ Washington Bomfim, Jan 11 2011
    
  • PARI
    is(n)=isprime(n) && hammingweight(n)==4 \\ Charles R Greathouse IV, Jul 30 2016
    
  • PARI
    list(lim)=my(v=List(),t); for(a=3,logint(lim\=1,2), for(b=2,a-1, for(c=1,b-1, t=1<lim, return(Vec(v))); if(isprime(t), listput(v,t))))); Vec(v) \\ Charles R Greathouse IV, Jul 30 2016
    
  • Python
    from itertools import count, islice
    from sympy import isprime
    from sympy.utilities.iterables import multiset_permutations
    def A095077_gen(): # generator of terms
        return filter(isprime,map(lambda s:int('1'+''.join(s)+'1',2),(s for l in count(2) for s in multiset_permutations('0'*(l-2)+'11'))))
    A095077_list = list(islice(A095077_gen(),30)) # Chai Wah Wu, Jul 19 2022

A095078 Primes with a single 0 bit in their binary expansion.

Original entry on oeis.org

2, 5, 11, 13, 23, 29, 47, 59, 61, 191, 223, 239, 251, 383, 479, 503, 509, 991, 1019, 1021, 2039, 3583, 3967, 4079, 4091, 4093, 6143, 15359, 16127, 16319, 16381, 63487, 65407, 65519, 129023, 131063, 245759, 253951, 261631, 261887, 262079
Offset: 1

Views

Author

Antti Karttunen, Jun 01 2004

Keywords

Comments

Except for the first value 2, the sequence gives the primes of the form 2^k -2^j -1 with 0 < j < k-1. If j=k-1 we obtain the Mersenne primes. - Pierre CAMI, May 19 2005
{2} UNION (A000040 INTERSECT A190620). - Chai Wah Wu, Dec 19 2024

Crossrefs

Intersection of A000040 and A030130. Cf. A095058, A190620.

Programs

  • Mathematica
    Select[Prime[Range[23000]],DigitCount[#,2,0]==1&] (* Harvey P. Dale, Nov 28 2019 *)
  • PARI
    forprime(p=2,262079,v=binary(p);s=0;for(k=1,#v,s+=v[k]);if(#v-s==1,print1(p,", "))) \\ Washington Bomfim, Jan 13 2011

A095084 Fibevil primes, i.e., primes p whose Zeckendorf-expansion A014417(p) contains an even number of 1-fibits.

Original entry on oeis.org

7, 11, 23, 29, 37, 47, 53, 67, 83, 97, 101, 109, 127, 137, 139, 149, 157, 163, 193, 199, 223, 241, 263, 271, 277, 281, 283, 311, 317, 331, 337, 359, 373, 379, 389, 397, 409, 421, 439, 443, 461, 499, 503, 521, 547, 557, 563, 577, 593, 601, 607
Offset: 1

Views

Author

Antti Karttunen, Jun 01 2004

Keywords

Crossrefs

Intersection of A000040 and A095096.

Programs

  • Mathematica
    Select[Flatten[Position[Mod[DigitCount[Select[Range[0, 6000], BitAnd[#, 2 #] == 0 &], 2, 1], 2], 0]] - 1, PrimeQ] (* Amiram Eldar, Feb 07 2023 *)
Previous Showing 11-20 of 143 results. Next