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.

Showing 1-1 of 1 results.

A300854 a(n) is the smallest prime p = prime(k) such that A300845(k) = prime(n), or 0 if no such k exists.

Original entry on oeis.org

3, 2, 79, 5, 19, 71, 211, 47, 307, 181, 479, 83, 1231, 293, 547, 1021, 499, 683, 251, 643, 863, 2243, 1009, 1447, 2213, 3361, 4691, 2137, 2657, 2131, 929, 4621, 5851, 1721, 7591, 1901, 11243, 3191, 19501, 3343, 2551, 2927, 997, 4703, 4177, 2789, 14537, 10331, 28723, 36899, 11311, 42433, 29429, 9631
Offset: 1

Views

Author

Robert Israel and Altug Alkan, Mar 13 2018

Keywords

Comments

Is a(n) always positive?

Examples

			a(3) = prime(22) = 79 since least k such that A300845(k) = prime(3) = 5 is 22.
		

Crossrefs

Cf. A300845.

Programs

  • Maple
    f:= proc(p) local q;
      q:= 1;
      do
        q:= nextprime(q);
        if isprime(q^2+q*p+p^2) then return q fi;
      od
    end proc:
    V:= Vector(100):
    p:= 1: count:= 0:
    while count < 100 do
    p:= nextprime(p);
    v:= numtheory:-pi(f(p));
    if v <= 100 and V[v] = 0 then V[v]:= p; count:= count+1; fi
    od:
    convert(V,list);
  • Mathematica
    With[{s = Table[Block[{q = 2}, While[! PrimeQ[q^2 + q p + p^2], q = NextPrime@ q]; q], {p, Prime@ Range[10^4]}]}, TakeWhile[#, # > 0 &] &@ Table[Prime@ First@ FirstPosition[s, p] /. k_ /; ! IntegerQ@ k -> -1, {p, Prime@ Range@ PrimePi@ Max@ s}] ] (* Michael De Vlieger, Mar 16 2018 *)
  • PARI
    a300845(n) = {my(p=prime(n)); forprime(q=2, ,if(isprime(p^2+p*q+q^2), return(q)))}
    a(n) = {my(k=1); while(a300845(k) != prime(n), k++); prime(k); }
Showing 1-1 of 1 results.