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

A100714 Number of runs in binary expansion of A000040(n) (the n-th prime number) for n > 0.

Original entry on oeis.org

2, 1, 3, 1, 3, 3, 3, 3, 3, 3, 1, 5, 5, 5, 3, 5, 3, 3, 3, 3, 5, 3, 5, 5, 3, 5, 3, 5, 5, 3, 1, 3, 5, 5, 7, 5, 5, 5, 5, 7, 5, 7, 3, 3, 5, 3, 5, 3, 3, 5, 5, 3, 3, 3, 3, 3, 5, 3, 7, 5, 5, 7, 5, 5, 5, 5, 7, 7, 7, 7, 5, 5, 5, 7, 5, 3, 5, 5, 5, 5, 5, 7, 5, 5, 5, 5, 3, 5, 5, 3, 5, 3, 3, 5, 3, 3, 3, 5, 5, 5, 5, 7, 5, 5, 5
Offset: 1

Views

Author

Joseph Biberstine (jrbibers(AT)indiana.edu), Dec 11 2004

Keywords

Comments

Record values of a(n) = 2, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, ... are set at the indices n = 1, 3, 12, 35, 121, 355, 1317, 4551, 15897, 56475, 197249, 737926, ... - R. J. Mathar, Mar 02 2007

Examples

			a(5)=3 because A000040(5) = 11_10 = 1011_2, which splits into three runs ({1}, {0}, {1,1}).
		

Crossrefs

Programs

  • Maple
    A100714 := proc(n)
        A005811(ithprime(n)) ;
    end proc:
    seq( A100714(n),n=1..105) ; # R. J. Mathar, Jul 08 2025
  • Mathematica
    Table[Length[Split[IntegerDigits[Prime[n], 2]]], {n, 1, 128}]
  • PARI
    a(n,p=prime(n))=hammingweight(bitxor(p, p>>1)) \\ Charles R Greathouse IV, Oct 19 2015
    
  • Python
    from sympy import prime
    def a(n): return ((p:=prime(n))^(p>>1)).bit_count()
    print([a(n) for n in range(1, 106)]) # Michael S. Branicky, Feb 25 2023

Formula

a(n) = A005811(A000040(n)).

A043570 Numbers whose base-2 representation has exactly 3 runs.

Original entry on oeis.org

5, 9, 11, 13, 17, 19, 23, 25, 27, 29, 33, 35, 39, 47, 49, 51, 55, 57, 59, 61, 65, 67, 71, 79, 95, 97, 99, 103, 111, 113, 115, 119, 121, 123, 125, 129, 131, 135, 143, 159, 191, 193, 195, 199, 207, 223, 225, 227, 231, 239, 241, 243, 247
Offset: 1

Views

Author

Keywords

Comments

Numbers of the form 2^n - 2^m + 2^k - 1 for n > m > k > 0. - Robert Israel, Jan 11 2018
A000051 \ {2, 3} is a subsequence, since the base-2 representation of a number of the form 2^k+1 > 3 consists of a single 1, followed by a block of k-1 0's, followed by a last single 1. Also, A000215 \ {3} is another subsequence, since the base-2 representation of a Fermat number 2^(2^k)+1 > 3 consists of a single 1, followed by a block of 2^k-1 0's, followed by a last single 1. - Bernard Schott, Mar 09 2023
Numbers k such that A005811(k) = 3. - Michel Marcus, Mar 10 2023

Examples

			115 = 1110011_2, which is a block of three 1's, followed by a block of two 0's, followed by a block of two 1's, so 115 is a term.
		

Crossrefs

Cf. A005811.
Cf. A082554 (subsequence of primes).

Programs

  • Maple
    seq(seq(seq(2^n-2^m+2^k-1, k=1..m-1),m=n-1..2,-1),n=2..10); # Robert Israel, Jan 11 2018
  • Python
    from itertools import count, islice
    def agen(): yield from ((1<Michael S. Branicky, Feb 25 2023

A100722 Prime numbers whose binary representations are split into exactly five runs.

Original entry on oeis.org

37, 41, 43, 53, 73, 83, 89, 101, 107, 109, 137, 139, 151, 157, 163, 167, 179, 197, 211, 229, 233, 269, 281, 283, 307, 311, 313, 317, 353, 359, 367, 379, 389, 397, 401, 409, 419, 431, 433, 439, 443, 457, 461, 467, 491, 521, 523, 541, 547, 563, 569, 571, 577
Offset: 1

Views

Author

Joseph Biberstine (jrbibers(AT)indiana.edu), Dec 11 2004

Keywords

Comments

The n-th prime is a term iff A100714(n)=5.

Examples

			a(3)=43 is a term because it is the 3rd prime whose binary representation splits into exactly five runs. 43_10 = 101011_2 splits into {{1}, {0}, {1}, {0}, {1,1}}.
		

Crossrefs

Cf. A100714, A000668 (exactly 1 run), A082554 (exactly 3 runs), A100723 (exactly 7 runs).

Programs

  • Mathematica
    Select[Table[Prime[k], {k, 1, 50000}], Length[Split[IntegerDigits[ #, 2]]] == 5 &]
Showing 1-3 of 3 results.