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.

A351051 a(n) is the least prime that begins a sequence of exactly n primes under iteration of the map x -> (x^2+2)/3.

Original entry on oeis.org

3, 11, 17, 7, 25781659, 13505561767
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Jan 30 2022

Keywords

Examples

			7 is prime, (7^2+2)/3 = 17 is prime, (17^2+2)/3 = 97 is prime, (97^2+2)/3 = 3137 is prime, but (3137^2+2)/3 = 3280257 is not prime, so 7 begins the sequence of 4 primes (7, 17, 97, 3137).  Since this is the first prime to do so, a(4) = 7.
		

Crossrefs

Cf. A109953.

Programs

  • Maple
    f:= proc(p) option remember; local q;
      q:= (p^2+2)/3;
      if isprime(q) then 1 + procname(q) else 1 fi
    end proc:
    A:= Vector(5): count:= 0:
    p:= 3:
    while count < 5 do
    p:= nextprime(p);
    v:= f(p);
    if A[v] = 0 then A[v]:= p; count:= count+1; fi;
    od:
    convert(A,list);
  • Mathematica
    f[n_] := -1 + Length @ NestWhileList[(#^2 + 2)/3 &, n, PrimeQ]; a[n_] := Module[{p = 3}, While[f[p] != n, p = NextPrime[p]]; p]; Array[a, 4] (* Amiram Eldar, Feb 01 2022 *)

Extensions

a(6) from Amiram Eldar, Feb 01 2022