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.

A258578 Primes p such that difference between p and next prime after p is multiple of 6.

Original entry on oeis.org

23, 31, 47, 53, 61, 73, 83, 131, 151, 157, 167, 173, 199, 211, 233, 251, 257, 263, 271, 331, 353, 367, 373, 383, 433, 443, 467, 503, 509, 523, 541, 557, 563, 571, 587, 593, 601, 607, 619, 647, 653, 661, 677, 727, 733, 751, 797, 941, 947, 971, 977, 991, 997
Offset: 1

Views

Author

Zak Seidov, Jun 04 2015

Keywords

Comments

A031924 is subsequence: first 12 terms are the same.

Examples

			a(1)=23 because next prime after 23 is 29=23+6,
a(13)=199 because next prime after 199 is 211=199+12,
a(30)=523 because next prime after 523 is 541=523+18,
a(90)=1669 because next term after 1669 is 1693=1669+24,
a(199)=4297 because next prime after 4297 is 4327=4297+30.
		

Crossrefs

Programs

  • Mathematica
    Select[Partition[Prime[Range[200]],2,1],Mod[#[[2]]-#[[1]],6]==0&][[All,1]] (* Harvey P. Dale, Jun 20 2019 *)
  • PARI
    lista(nn) = forprime(p=2, nn, if (!((nextprime(p+1) - p) % 6), print1(p, ", "));); \\ Michel Marcus, Jun 04 2015
    
  • PARI
    v=List();p=2; forprime(q=3,1e4,if((q-p)%6==0,listput(v,p));p=q); v \\ Charles R Greathouse IV, Jun 04 2015

A355161 Primes p such that p - prevprime(p) is not a power of 2.

Original entry on oeis.org

29, 37, 53, 59, 67, 79, 89, 127, 137, 149, 157, 163, 173, 179, 191, 211, 223, 239, 251, 257, 263, 269, 277, 293, 307, 331, 337, 347, 359, 373, 379, 389, 419, 431, 439, 449, 479, 509, 521, 541, 547, 557, 563, 569, 577, 587, 593, 599, 607, 613
Offset: 1

Views

Author

Reed Michael Upson, Jun 21 2022

Keywords

Comments

A130796(n) is prevprime(p).
A031925 and A031931 are subsequences, as 6 and 12 are not powers of 2.

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[2, 120]], (d = # - NextPrime[#, -1]) != 2^IntegerExponent[d, 2] &] (* Amiram Eldar, Jun 22 2022 *)
  • PARI
    isp2(n) = my(p); (n==1) || (isprimepower(n, &p) && (p==2)); \\ A000079
    isok(p) = isprime(p) && !isp2(p-precprime(p-1)) \\ Michel Marcus, Jun 22 2022
    
  • Python
    from itertools import islice, count
    from sympy import prime, prevprime
    def A355161_gen(): # generator of terms
        return filter(lambda n:((~(m:=n-prevprime(n))+1)&m)-m, (prime(n) for n in count(2)))
    A355161_list = list(islice(A355161_gen(),30)) # Chai Wah Wu, Aug 23 2022

Formula

a(n) = A151800(A130796(n)).
Showing 1-2 of 2 results.