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

A307833 Smallest k > 1 such that A014574(n)*k is adjacent to a prime.

Original entry on oeis.org

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

Views

Author

Dmitry Kamenetsky, May 01 2019

Keywords

Comments

It is perhaps surprising that the values in this sequence are so small. For n < 8000 the largest value of a(n) is 20, which occurs for n = 4928. Also for n < 8000, a(n) is 2 on 2449 occasions.
a(n)=2 if and only if A014574(n)+1 is in A038869 or A014574(n)-1 is in A045536. - Robert Israel, Jul 17 2019

Examples

			72*5 = 360, which is adjacent to the prime 359, so a(8) = 5.
		

Crossrefs

Programs

  • Maple
    P:= {seq(ithprime(i),i=1..10^4)}:
    A014574:= sort(convert(map(t -> t+1, P intersect map(`-`,P,2)),list)):
    f:= proc(m) local k;
      for k from 2 do
        if isprime(k*m-1) or isprime(k*m+1) then return k fi
      od
    end proc:
    map(f, A014574); # Robert Israel, Jul 17 2019
  • Mathematica
    primeNearQ[n_] := AnyTrue[{-1, 1} + n, PrimeQ]; twinMidQ[n_] := AllTrue[{-1, 1} + n, PrimeQ]; f[n_] := Module[{k = 2}, While[! primeNearQ[k*n], k++]; k]; f /@ Select[Range[10^4], twinMidQ] (* Amiram Eldar, Jul 05 2019 *)
  • PARI
    isok2(n) = isprime(n-1) && isprime(n+1);
    k(n) = my(k=2); while (! (isprime(n*k-1) || isprime(n*k+1)), k++); k;
    lista(nn) = for (n=1, nn, if (isok2(n), print1(k(n), ", "))); \\ Michel Marcus, May 01 2019

Formula

a(n) = A309120(A014574(n)). - Robert Israel, Jul 17 2019
Showing 1-1 of 1 results.