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.

A224489 Smallest k such that k*2*p(n)^2-1 is prime.

Original entry on oeis.org

1, 1, 3, 1, 1, 1, 1, 4, 4, 6, 4, 6, 1, 1, 9, 10, 1, 6, 4, 7, 1, 4, 3, 4, 3, 10, 4, 4, 1, 1, 1, 10, 1, 7, 6, 12, 1, 9, 6, 3, 1, 1, 6, 3, 1, 1, 1, 3, 3, 4, 4, 21, 4, 1, 3, 1, 6, 4, 1, 10, 3, 1, 15, 1, 3, 4, 9, 13, 10, 9, 1, 4, 1, 3, 1, 3, 12, 9, 6, 1, 1, 22, 4, 1
Offset: 1

Views

Author

Pierre CAMI, Apr 08 2013

Keywords

Examples

			1*2*2^2-1=7 is prime, p(1)=2 so a(1)=1.
1*2*3^2-1=17 is prime, p(2)=3 so a(2)=1.
1*2*5^2-1=49 is composite; 2*2*5^2-1=99 is composite; 3*2*5^2-1=149 is prime, p(3)=5 so a(3)=3.
		

Crossrefs

Programs

  • Magma
    S:=[];
    k:=1;
    for n in [1..90] do
      while not IsPrime(k*2*NthPrime(n)^2-1) do
           k:=k+1;
      end while;
      Append(~S, k);
      k:=1;
    end for;
    S; // Bruno Berselli, Apr 18 2013
  • Mathematica
    a[n_] := For[k = 1, True, k++, If[ PrimeQ[k*2*Prime[n]^2 - 1], Return[k]]]; Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Apr 10 2013 *)