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.

A090000 Length of longest contiguous block of 1's in binary expansion of n-th prime.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Nov 20 2003

Keywords

Comments

a(n) = A038374(A000040(n)).

Crossrefs

Programs

  • Mathematica
    f[n_] := Length[ Union[ DeleteCases[ Split[ IntegerDigits[n, 2]], 0, 2]][[ -1]]]; Table[ f[ Prime[n]], {n, 1, 105}] (* Robert G. Wilson v, Dec 04 2003 *)

A090587 Smallest prime with exactly n consecutive zeros in the longest run of zeros in its binary expansion.

Original entry on oeis.org

3, 2, 19, 17, 67, 131, 641, 257, 2053, 10243, 4099, 12289, 40961, 32771, 65539, 65537, 262147, 786433, 4194319, 7340033, 23068673, 50331653, 67108879, 436207619, 167772161, 268435463, 268435459, 1073741831, 1073741827, 3221225473, 21474836483, 68719476767
Offset: 0

Views

Author

Robert G. Wilson v, Dec 03 2003

Keywords

Comments

Except for 2, the first and last binary digits of a prime number are 1.
One may also define a sequence of the smallest prime with its longest run of zeros containing *at least* n zeros in the binary expansion: 2, 2, 17, 17, 67, 131, 257, 257, 2053, 4099,.... - R. J. Mathar, Sep 09 2013

Examples

			a(0) = 3 since 3_d = 11_b. a(1) = 2 since 2_d = 10_b. a(3) = 17 since 17_d = 10001_b. a(6) = 641 since 641_d = 1010000001_b.
		

Crossrefs

Programs

  • Mathematica
    a = Table[0, {30}]; NextPrim[n_] := Block[{k = n + 1}, While[ ! PrimeQ[k], k++ ]; k]; p = 2; Do[ m = Length[ Union[ DeleteCases[ Split[ IntegerDigits[p, 2]], 1, 2]][[ -1]]]; If[ a[[m + 1]] == 0, a[[m + 1]] = p]; p = NextPrim[p], {n, 1, 117000000}]

Formula

min{ A000040(k): A090046(k) = n}. - R. J. Mathar, Sep 09 2013

Extensions

a(29)-a(31) from Donovan Johnson, Sep 10 2013

A307503 Least prime containing at least n consecutive 1's in its binary representation.

Original entry on oeis.org

2, 2, 3, 7, 31, 31, 127, 127, 1021, 3583, 4093, 6143, 8191, 8191, 81919, 131071, 131071, 131071, 524287, 524287, 4194301, 14680063, 16777213, 67108859, 536870909, 536870909, 536870909, 536870909, 2147483647, 2147483647, 2147483647, 2147483647, 21474836479
Offset: 0

Views

Author

John Mason, Apr 11 2019

Keywords

Comments

For n > 0, a(n) = A000040(m) for the lowest m such that A090000(m) >= n.
a(n) = A087522(n) for n = 0 through 7, and in all other cases when a(n) is a base 2 repunit (Mersenne) prime.

Examples

			a(0) = 2, the smallest prime containing >= 0 1's.
a(1) = 2, the smallest prime containing >= 1 consecutive 1's.
a(2) = 3, the smallest prime containing >= 2 consecutive 1's.
		

Crossrefs

Cf. A090593 (with exactly n consecutive ones).

Programs

  • PARI
    nbo(n)=if (n==0, return (0)); n>>=valuation(n, 2); if(n<2, return(n)); my(e=valuation(n+1, 2)); max(e, nbo(n>>e)); \\ A038374
    a(n) = my(p=2); while(nbo(p) < n, p=nextprime(p+1)); p; \\ Michel Marcus, Apr 14 2019

Formula

a(n) <= A201914(n). - Rémy Sigrist, Apr 11 2019
a(n) = min_{k>=n} A090593(k). - Chai Wah Wu, Apr 26 2019

Extensions

a(28)-a(32) from Chai Wah Wu, Apr 26 2019
Showing 1-3 of 3 results.