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.

A224493 Smallest k such that k*2*p(n)^2+1 is prime.

This page as a plain text file.
%I A224493 #20 Sep 22 2019 17:04:13
%S A224493 2,1,2,2,3,2,6,15,12,6,8,2,5,6,2,14,3,23,2,5,2,3,5,3,6,11,2,9,3,5,6,3,
%T A224493 14,8,5,6,2,2,5,9,8,11,3,2,11,3,6,5,6,5,2,5,3,8,15,14,3,5,20,5,6,14,
%U A224493 14,8,5,2,8,2,6,18,14,3,6,9,5,12,3,9,15,18,6,6,3
%N A224493 Smallest k such that k*2*p(n)^2+1 is prime.
%H A224493 Pierre CAMI, <a href="/A224493/b224493.txt">Table of n, a(n) for n = 1..10000</a>
%t A224493 a[n_] := For[k = 1, True, k++, p = Prime[n]; If[PrimeQ[k*2*p^2 + 1], Return[k]]]; Table[ a[n] , {n, 1, 83}] (* _Jean-François Alcover_, Apr 12 2013 *)
%t A224493 sk[n_]:=Module[{k=1},While[!PrimeQ[2*k*n^2+1],k++];k]; Table[sk[n],{n,Prime[ Range[ 90]]}] (* _Harvey P. Dale_, Sep 22 2019 *)
%o A224493 (PFGW & SCRIPTIFY)
%o A224493 SCRIPT
%o A224493 DIM k
%o A224493 DIM i,0
%o A224493 DIM q
%o A224493 DIMS t
%o A224493 OPENFILEOUT myf,a(n).txt
%o A224493 LABEL a
%o A224493 SET i,i+1
%o A224493 IF i>10000 THEN END
%o A224493 SET k,0
%o A224493 LABEL b
%o A224493 SET k,k+1
%o A224493 SETS t,%d,%d,%d\,;k;i;p(i)
%o A224493 SET q,k*2*p(i)^2+1
%o A224493 PRP q,t
%o A224493 IF ISPRP THEN WRITE myf,t
%o A224493 IF ISPRP THEN GOTO a
%o A224493 GOTO b
%Y A224493 Cf. A224489, A224490, A224491, A224492, A224494, A224495, A224496.
%K A224493 nonn
%O A224493 1,1
%A A224493 _Pierre CAMI_, Apr 08 2013