login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A300854
a(n) is the smallest prime p = prime(k) such that A300845(k) = prime(n), or 0 if no such k exists.
0
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,1
COMMENTS
Is a(n) always positive?
EXAMPLE
a(3) = prime(22) = 79 since least k such that A300845(k) = prime(3) = 5 is 22.
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 *)
PROG
(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); }
CROSSREFS
Cf. A300845.
Sequence in context: A016461 A069576 A249678 * A358596 A323745 A109899
KEYWORD
nonn
AUTHOR
Robert Israel and Altug Alkan, Mar 13 2018
STATUS
approved