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.

A113858 Difference between A095765 and A095766.

Original entry on oeis.org

0, 0, 0, 1, 1, -1, 1, 1, 1, 3, 5, 10, 10, 38, 48, 85, 157, 280, 477, 900, 1540, 2894, 5464, 9762, 18132, 33450, 62364, 116657, 217500, 407235, 763246, 1432291, 2698847, 5087838, 9620802, 18210979, 34487702, 65417618, 124353014, 236558508
Offset: 1

Views

Author

Robert G. Wilson v, Jan 24 2006

Keywords

Comments

A095765: Number of primes whose binary expansion begins '10' less A095766: Number of primes whose binary expansion begins '11'.
The difference between successive runs of A112416.
A112416: a(n) = next-to-most-significant binary digit of n-th prime.

Crossrefs

Programs

  • Mathematica
    f[n_] := PrimePi[2^n + 2^(n - 1)] - PrimePi[2^n] - PrimePi[2^(n + 1)] + PrimePi[2^n + 2^(n - 1) - 1]; Array[f, 40]

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

A112416 Next-to-most-significant binary digit of the n-th prime.

Original entry on oeis.org

0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Leroy Quet, Dec 09 2005

Keywords

Comments

The length of the run of zeros pi(2^n+2^(n-1))-pi(2^n) (A095765): 1, 1, 1, 3, 4, 6, 12, 22, 38, 70, 130, 237, 441, ... and the length of the run of ones pi(2^n-1)-pi(2^n-2^(n-2)-1) (A095766): 1, 1, 1, 2, 3, 7, 11, 21, 37, 67, 125, 227, 431, ..., . - Robert G. Wilson v

Examples

			The 9th prime is 23 (in decimal), which is 10111 in binary. So a(9) = 0, the next-to-most significant binary digit of 23.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := IntegerDigits[Prime@n, 2][[2]]; Array[f, 105] (* Robert G. Wilson v *)

Formula

a(n) = floor((p(n) - 2^m)/2^(m-1)), where p(n) is the n-th prime and m = floor(log(p(n))/log(2)).

Extensions

More terms from Robert G. Wilson v, Jan 24 2006

A096369 Triangle read by rows, 0<=k

Original entry on oeis.org

0, 1, 2, 2, 1, 2, 2, 1, 1, 2, 5, 3, 3, 2, 5, 7, 3, 4, 5, 3, 7, 13, 7, 6, 6, 4, 7, 13, 23, 13, 12, 9, 10, 12, 11, 23, 43, 22, 23, 22, 23, 22, 21, 21, 43, 75, 37, 37, 36, 40, 39, 38, 38, 37, 75, 137, 71, 71, 73, 66, 56, 71, 70, 66, 67, 137, 255, 128, 125, 130, 127, 132, 128, 130, 129, 126, 125, 255
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 19 2004

Keywords

Comments

T(n,0) = A036378(n-1) for n>1; T(n,n-1) = T(n,0) for n>2;
T(n,1) = A095008(n-1) for n>2;
T(n,n-2) = A095766(n-1) for n>1;
conjecture: T(n,k) > 0 for n>1.

Examples

			prime(12) = 37 -> 1 0 0 1 0 1 ..... n = 6
prime(13) = 41 -> 1 0 1 0 0 1 ..... all primes p:
prime(14) = 43 -> 1 0 1 0 1 1 ..... 2^(6-1) <= p < 2^6
prime(15) = 47 -> 1 0 1 1 1 1
prime(16) = 53 -> 1 1 0 1 0 1
prime(17) = 59 -> 1 1 1 0 1 1
prime(18) = 61 -> 1 1 1 1 0 1
col-sums of bits: 7 3 5 4 3 7 : T(6,5)=7, T(6,4)=3, T(6,3)=5,
...
		

Programs

  • Mathematica
    S[n_] := S[n] = IntegerDigits[Select[Range[2^(n-1), 2^n], PrimeQ], 2] // Transpose;
    T[1, 1] = 0;
    T[n_, k_] := S[n][[n-k+1]] // Total;
    Table[T[n, k], {n, 1, 12}, {k, 1, n}] // Flatten (* Jean-François Alcover, Sep 14 2021 *)
Showing 1-4 of 4 results.