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.

A309498 Least number k > 0 such that 4*p^2*k^2 + 1 is prime, where p = prime(n) is the n-th prime.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 5, 15, 4, 2, 2, 1, 13, 5, 1, 6, 2, 13, 1, 2, 1, 3, 9, 5, 10, 5, 1, 5, 2, 9, 6, 8, 4, 2, 7, 3, 1, 1, 10, 11, 2, 7, 2, 1, 4, 5, 13, 4, 4, 3, 1, 3, 7, 2, 4, 6, 3, 7, 5, 2, 20, 6, 4, 2, 6, 1, 2, 1, 4, 3, 4, 3, 5, 5, 5, 16, 2, 14, 3, 3, 2, 2, 5, 5
Offset: 1

Views

Author

Amiram Eldar, Aug 05 2019

Keywords

Comments

Gagola calculated the first 669 terms of this sequence (for all the primes p < 5000) using an HP 9830 in 1981. She found that the largest value of k was only 45 and that 84% of the values of k were less than or equal to 10.
The Generalized Dickson Conjecture implies that the sequence contains each positive integer infinitely many times. - Robert Israel, Aug 05 2019

Examples

			a(1) = 1 since 4*1^2*prime(1)^2 + 1 = 4*1*2^2 + 1 = 17 is prime.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local q,k;
      q:= 4*ithprime(n)^2;
      for k from 1 do
         if isprime(q*k^2+1) then return k fi
      od
    end proc:
    map(f, [$1..100]); # Robert Israel, Aug 05 2019
  • Mathematica
    a[n_] := Module[{k = 1, p = Prime[n]}, While[!PrimeQ[4 * k^2 * p^2 + 1], k++]; k]; Array[a, 100]
  • PARI
    a(n) = my(k=1, p=prime(n)); while (!isprime(4*p^2*k^2 + 1), k++); k; \\ Michel Marcus, Aug 05 2019