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.

A082466 Least k>=1 such that n^2+kn-1 and n^2+kn+1 are twin primes.

Original entry on oeis.org

3, 1, 1, 11, 1, 1, 53, 1, 3, 5, 7, 3, 11, 16, 1, 11, 43, 6, 11, 1, 1, 8, 13, 1, 17, 7, 3, 11, 43, 4, 11, 4, 7, 8, 31, 9, 17, 1, 9, 35, 1, 4, 53, 4, 7, 41, 43, 6, 23, 1, 17, 8, 67, 1, 5, 4, 17, 11, 1, 7, 197, 4, 3, 11, 25, 1, 227, 7, 3, 14, 157, 19, 11, 16, 3, 71, 43, 6, 53, 7, 7, 44, 31, 3, 41
Offset: 1

Views

Author

Benoit Cloitre, Apr 27 2003

Keywords

Programs

  • Maple
    A082466 := proc(n)
        local k,p ;
        for k from 1 do
            p := (n+k)*n-1 ;
            if isprime(p) and isprime(p+2) then
                return k;
            end if;
        end do:
    end proc: # R. J. Mathar, Jul 20 2012
  • Mathematica
    lk[n_]:=Module[{k=1},While[!And@@PrimeQ[n^2+k*n+{1,-1}],k++];k]; Array[ lk,90] (* Harvey P. Dale, Nov 25 2013 *)
  • PARI
    a(n)=if(n<0,0,k=1; while(isprime(n^2+k*n+1)*isprime(n^2+k*n-1)==0,s++); k)