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.

A082508 Differences between consecutive primes that are powers of 2 in order of their appearance. Differences that are not powers of 2 are deleted from A001223.

Original entry on oeis.org

1, 2, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 8, 4, 2, 4, 2, 4, 4, 2, 2, 4, 2, 2, 4, 2, 4, 2, 4, 2, 2, 4, 2, 4, 2, 4, 2, 4, 8, 4, 8, 4, 8, 2, 2, 4, 8, 4, 2, 4, 8, 4, 8, 4, 2, 2, 2, 4, 2, 2, 4, 2, 4, 8, 8, 8, 4, 8, 4, 8, 4, 2, 2, 4, 2, 4, 2, 4, 4, 2, 4, 4, 8, 8, 4, 4, 8, 4, 2, 2, 2, 2, 4, 2, 4, 8, 2, 8, 8, 4, 2
Offset: 1

Views

Author

Labos Elemer, Apr 28 2003

Keywords

Crossrefs

Programs

  • Mathematica
    Do[s=Log[2, Prime[n+1]-Prime[n]]; If[IntegerQ[s], Print[Prime[n+1]]], {n, 1, 1000}]
  • PARI
    lista(pmax) = {my(p1 = 2, gap); forprime(p2 = 3, pmax, gap = p2 - p1; if(gap >> valuation(gap, 2) == 1, print1(gap, ", ")); p1 = p2);} \\ Amiram Eldar, Jun 06 2024

Formula

a(n) = A001223(A061771(n)). - Amiram Eldar, Jun 06 2024