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

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

A160058 Primes whose distance to both nearest neighbor primes is not of the form 2^k.

Original entry on oeis.org

53, 157, 173, 211, 251, 257, 263, 293, 331, 337, 373, 509, 541, 547, 557, 563, 577, 587, 593, 607, 631, 653, 733, 787, 797, 839, 947, 953, 977, 997, 1039, 1069, 1103, 1123, 1129, 1181, 1187, 1223, 1237, 1249, 1259, 1327, 1361, 1367, 1399, 1409, 1459, 1471
Offset: 1

Views

Author

Jonathan Vos Post, May 01 2009

Keywords

Comments

Intersection with A061771 yields an empty set. - R. J. Mathar, May 21 2009

Crossrefs

Cf. A000040. This is a proper subsequence of A137869.

Programs

  • Maple
    isA000079 := proc(n) if nops(numtheory[factorset](n)) > 1 then false; elif n mod 2 <> 0 then false; else true; fi; end: isA160058 := proc(p) o := prevprime(p) ; q := nextprime(p) ; if isprime(p) and not isA000079(q-p) and not isA000079(p-o) then true; else false; fi; end: for n from 2 to 1000 do p := ithprime(n) ; if isA160058(p) then printf("%d,",p) ; fi; od: # R. J. Mathar, May 21 2009
  • Mathematica
    n2kQ[n_]:=Module[{d=Differences[n]},!IntegerQ[Log[2,First[d]]] && !IntegerQ[ Log[ 2,Last[d]]]]; Transpose[Select[Partition[Prime[ Range[ 300]],3,1],n2kQ]][[2]] (* Harvey P. Dale, Mar 05 2014 *)
  • PARI
    t=0;p=2;forprime(q=3,999, t*(t=q-p-1<
    				

Extensions

More terms from M. F. Hasler, May 02 2008
Edited by N. J. A. Sloane, May 02 2009, based on comments from M. F. Hasler
More terms from R. J. Mathar, May 21 2009
Showing 1-2 of 2 results.