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.

A307775 Smallest k > 1 such that A014574(n)*k is in A014574.

Original entry on oeis.org

3, 2, 5, 4, 2, 10, 3, 6, 10, 4, 6, 4, 9, 6, 15, 21, 13, 3, 15, 6, 6, 8, 6, 5, 4, 11, 5, 26, 6, 2, 2, 6, 6, 11, 4, 5, 4, 6, 14, 6, 20, 9, 46, 5, 9, 4, 14, 11, 9, 20, 21, 6, 6, 4, 6, 14, 4, 9, 9, 3, 21, 5, 35, 15, 14, 2, 5, 30, 36, 4, 5, 14, 2, 29, 21, 10, 39, 8, 4, 5, 9, 3
Offset: 1

Views

Author

Dmitry Kamenetsky, Apr 28 2019

Keywords

Crossrefs

Cf. A014574.

Programs

  • Maple
    P:= select(isprime, {seq(i,i=3..10^7,2)}):
    A14574:= sort(convert(map(`+`,P,1) intersect map(`+`,P,-1),list)):
    f:= proc(n) local k,v,kv;
      v:= A14574[n]:
      for k from 2 do
        kv:= k*v;
        if kv > 10^7 then if isprime(kv-1) and isprime(kv+1) then return k fi
        elif member(kv,A14574) then return k
        fi
      od
    end proc:
    map(f, [$1..100]); # Robert Israel, Dec 17 2020
  • Mathematica
    twinMidQ[n_] := AllTrue[{-1, 1} + n, PrimeQ]; f[n_] := Module[{k = 2}, While[! twinMidQ[k*n], k++]; k]; f /@ Select[Range[10^3], twinMidQ] (* Amiram Eldar, Jul 05 2019 *)
  • PARI
    isok2(n) = isprime(n-1) && isprime(n+1);
    k(n) = my(k=2); while (! isok2(n*k), k++); k;
    lista(nn) = for (n=1, nn, if (isok2(n), print1(k(n), ", "))); \\ Michel Marcus, Apr 28 2019