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.

A095298 Sum of 1-bits between the most and least significant bits summed for all primes in range ]2^n,2^(n+1)].

Original entry on oeis.org

0, 1, 2, 8, 15, 30, 67, 154, 302, 611, 1280, 2546, 5207, 10447, 21123, 42783, 85726, 173102, 347243, 698544, 1401784, 2813930, 5644165, 11328192, 22712057, 45538473, 91288241, 182965151, 366691833, 734702678, 1471976078, 2948741819
Offset: 1

Views

Author

Antti Karttunen, Jun 04 2004

Keywords

Comments

Ratio a(n)/A036378(n) (i.e. average number of 1-bits in range ]most significant bit,least significant bit[ of primes p which 2^n < p < 2^(n+1)) grows as: 0, 0.5, 1, 1.6, 2.142857, 2.307692, 2.913043, 3.581395, 4.026667, 4.459854, 5.019608, 5.487069, 5.97133, 6.480769, 6.971287, 7.493957, 7.975254, 8.489554, 8.987783, 9.492893, 9.98877, 10.491283, 10.987107, 11.49116, 11.990823, 12.490859, 12.990533, 13.491108, 13.991985, 14.491881, 14.992221, 15.492331, 15.992713.
Ratio of that average compared to (n-1)/2 (the expected value of that same sum computed for all odd numbers in the same range) converges as: 1, 1, 1, 1.066667, 1.071429, 0.923077, 0.971014, 1.023256, 1.006667, 0.991079, 1.003922, 0.997649, 0.995222, 0.997041, 0.995898, 0.999194, 0.996907, 0.998771, 0.998643, 0.999252, 0.998877, 0.99917, 0.998828, 0.999231, 0.999235, 0.999269, 0.999272, 0.999341, 0.999427, 0.99944, 0.999481, 0.999505, 0.999545.

Examples

			a(1)=0, as only prime in range ]2,4] is 3, 11 in binary which has no space between its most and least significant bits. a(2)=1, as in that range there are two primes 5 (101 in binary) and 7 (111 in binary) and summing their middle bits we get 1. a(3)=2, as there are again two primes, 11 (1011 in binary) and 13 (1101 in binary) and summing the bits in the middle we get total 2.
		

Crossrefs

A095297, A095334. Cf. also A095353 (similar sums and ratios computed in Fibonacci number system).

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

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.

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.

A095765 Number of primes in range [2^n+1, 2^(n+1)] whose binary expansion begins '10' (A080165).

Original entry on oeis.org

0, 1, 1, 3, 4, 6, 12, 22, 38, 70, 130, 237, 441, 825, 1539, 2897, 5453, 10335, 19556, 37243, 70938, 135555, 259586, 497790, 956126, 1839597, 3544827, 6839282, 13212389, 25552386, 49472951, 95883938, 186011076, 361177503, 701906519
Offset: 1

Views

Author

Antti Karttunen, Jun 12 2004

Keywords

Comments

I.e., number of primes p such that 2^n < p < (2^n + 2^(n-1)).
Ratio a(n)/A036378(n) converges as follows: 0, 0.5, 0.5, 0.6, 0.571429, 0.461538, 0.521739, 0.511628, 0.506667, 0.510949, 0.509804, 0.510776, 0.505734, 0.511787, 0.507921, 0.507444, 0.507303, 0.506866, 0.506173, 0.506115, 0.505487, 0.505395, 0.505318, 0.504951, 0.504786, 0.504588, 0.504437, 0.504301, 0.50415, 0.504016, 0.503887, 0.503763, 0.503654
Ratio a(n)/A095766(n) converges as follows: 0, 1, 1, 1.5, 1.333333, 0.857143, 1.090909, 1.047619, 1.027027, 1.044776, 1.04, 1.044053, 1.023202, 1.048285, 1.032193, 1.030228, 1.029645, 1.027847, 1.025001, 1.024764, 1.022191, 1.021815, 1.021501, 1.020003, 1.019331, 1.01852, 1.017908, 1.017353, 1.016737, 1.016195, 1.015669, 1.015164, 1.014723
I think this explains also the bias present in ratios shown at A095297, A095298, etc.

Examples

			Table showing the derivation of the initial terms:
  n   2^n+1  2^(n+1)  a(n)   primes starting '10' in binary
  1     3       4      0       -
  2     5       8      1       5 = 101_2
  3     9      16      1      11 = 1011_2
  4    17      32      3      17 = 10001_2, 19 = 10011_2, 23 = 10111_2
		

Crossrefs

Programs

  • Mathematica
    a[n_] := PrimePi[2^n + 2^(n - 1) - 1] - PrimePi[2^n];
    Array[a, 35] (* Robert G. Wilson v, Jan 24 2006 *)

Formula

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

Extensions

a(34) and a(35) from Robert G. Wilson v, Jan 24 2006
Edited, restoring meaning of name, by Peter Munn, Jun 27 2023
Showing 1-5 of 5 results.