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.

A152075 a(n) = the smallest prime p > prime(n) such that p - prime(n) is squarefree, where prime(n) is the n-th prime.

Original entry on oeis.org

3, 5, 7, 13, 13, 19, 19, 29, 29, 31, 37, 43, 43, 53, 53, 59, 61, 67, 73, 73, 79, 89, 89, 103, 103, 103, 109, 109, 131, 127, 137, 137, 139, 149, 151, 157, 163, 173, 173, 179, 181, 191, 193, 199, 199, 229, 233, 229, 229, 239, 239, 241, 251, 257, 263, 269, 271, 277
Offset: 1

Views

Author

Leroy Quet, Nov 23 2008

Keywords

Comments

Indices for which a(n)M. F. Hasler, Nov 23 2008

Crossrefs

Cf. A152076.

Programs

  • Mathematica
    nxtp[n_]:=NestWhile[NextPrime[#]&,n,!SquareFreeQ[#-n]&]; nxtp/@Prime[Range[60]]  (* Harvey P. Dale, Apr 23 2011 *)
  • PARI
    A152075(n)=local( p=prime(n), q=p); until( issquarefree(q-p), q=nextprime(q+1)); q \\ M. F. Hasler, Nov 23 2008

Extensions

Terms beyond a(13) from M. F. Hasler and Ray Chandler, Nov 23 2008

A152073 a(n) = largest prime < prime(n) such that prime(n) - a(n) is a power of 2, where prime(n) is the n-th prime; a(n) = 0 if no such prime exists.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 13, 29, 29, 37, 41, 43, 37, 43, 59, 59, 67, 71, 71, 79, 73, 89, 97, 101, 103, 107, 109, 0, 127, 73, 137, 0, 149, 149, 131, 163, 157, 163, 179, 127, 191, 193, 197, 179, 191, 223, 227, 229, 223, 239, 0, 241, 199, 13, 269, 269, 277, 281, 277, 179
Offset: 2

Views

Author

Leroy Quet, Nov 23 2008

Keywords

Comments

a(n) = 0 for odd primes prime(n) appearing in A065381.
Primes p(n) for which there is no such prime a(n) (in which case a(n)=0) are listed in A065381 = (2,127,149,251,331,337,373,...). - M. F. Hasler, Nov 23 2008

Examples

			Looking at the primes less than the 10th prime = 29: 29 - 23 = 6, not a power of 2. 29-19 = 10, not a power of 2. 29-17 = 12, not a power of 2. But 29-13 = 16, a power of 2. Since p = 13 is the largest prime p such that 29 - p = a power of 2, then a(10) = 13.
		

Crossrefs

Programs

  • Mathematica
    Table[Max[0, Select[# - 2^Range[0, Log2@#] &@Prime[n], PrimeQ]], {n, 2, 63}] (* Ivan Neretin, Jun 10 2018 *)
  • PARI
    A152073(n)=local( q=n=prime(n)); while( q=precprime(q-1), n-q==1<M. F. Hasler, Nov 23 2008

Extensions

Edited and extended by M. F. Hasler and Ray Chandler, Nov 23 2008
Showing 1-2 of 2 results.