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.

A005574 Numbers k such that k^2 + 1 is prime.

This page as a plain text file.
%I A005574 M1010 #136 Apr 23 2025 23:32:42
%S A005574 1,2,4,6,10,14,16,20,24,26,36,40,54,56,66,74,84,90,94,110,116,120,124,
%T A005574 126,130,134,146,150,156,160,170,176,180,184,204,206,210,224,230,236,
%U A005574 240,250,256,260,264,270,280,284,300,306,314,326,340,350,384,386,396
%N A005574 Numbers k such that k^2 + 1 is prime.
%C A005574 Hardy and Littlewood conjectured that the asymptotic number of elements in this sequence not exceeding n is approximately c*sqrt(n)/log(n) for some constant c. - _Stefan Steinerberger_, Apr 06 2006
%C A005574 Also, nonnegative integers such that a(n)+i is a Gaussian prime. - _Maciej Ireneusz Wilczynski_, May 30 2011
%C A005574 Apparently Goldbach conjectured that any a > 1 from this sequence can be written as a=b+c where b and c are in this sequence (Lemmermeyer link below). - _Jeppe Stig Nielsen_, Oct 14 2015
%C A005574 No term > 2 can be both in this sequence and in A001105 because of the Aurifeuillean factorization (2*k^2)^2 + 1 = (2*k^2 - 2*k + 1) * (2*k^2 + 2*k + 1). - _Jeppe Stig Nielsen_, Aug 04 2019
%D A005574 Harvey Dubner, "Generalized Fermat primes", J. Recreational Math., 18 (1985): 279-280.
%D A005574 R. K. Guy, "Unsolved Problems in Number Theory", 3rd edition, A2.
%D A005574 G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, p. 15, Thm. 17.
%D A005574 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H A005574 T. D. Noe, <a href="/A005574/b005574.txt">Table of n, a(n) for n = 1..10000</a>
%H A005574 H. Dubner, <a href="/A006093/a006093_1.pdf">Generalized Fermat primes</a>, J. Recreational Math. 18.4 (1985-1986), 279. (Annotated scanned copy)
%H A005574 F. Ellermann, <a href="/A002496/a002496.txt">Primes of the form (m^2)+1 up to 10^6</a>.
%H A005574 L. Euler, <a href="http://eulerarchive.maa.org/correspondence/letters/OO0877.pdf">Lettre CXLIX</a> (to Goldbach), 1752.
%H A005574 L. Euler, <a href="https://scholarlycommons.pacific.edu/euler-works/283/">De numeris primis valde magnis</a>, Novi Commentarii academiae scientiarum Petropolitanae 9 (1764), pp. 99-153. See pp. 123-125.
%H A005574 R. K. Guy, <a href="/A000081/a000081.pdf">Letter to N. J. A. Sloane, 1988-04-12</a> (annotated scanned copy).
%H A005574 F. Lemmermeyer, <a href="http://mathoverflow.net/questions/14690/">Primes of the form a^2+1</a>, Math Overflow question (2010).
%H A005574 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/LandausProblems.html">Landau's Problems</a>.
%H A005574 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Power.html">Power</a>.
%H A005574 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Near-SquarePrime.html">Near-Square Prime</a>.
%H A005574 Marek Wolf, <a href="http://arXiv.org/abs/0803.1456">Search for primes of the form m^2+1</a>, arXiv:0803.1456 [math.NT], 2008-2010.
%F A005574 a(n) = A090693(n) - 1.
%F A005574 a(n) = 2*A001912(n-1) for n > 1. - _Jeppe Stig Nielsen_, Aug 04 2019
%t A005574 Select[Range[350], PrimeQ[ #^2 + 1] &] (* _Stefan Steinerberger_, Apr 06 2006 *)
%t A005574 Join[{1},2Flatten[Position[PrimeQ[Table[x^2+1,{x,2,1000,2}]],True]]]  (* _Fred Patrick Doty_, Aug 18 2017 *)
%o A005574 (PARI) isA005574(n) = isprime(n^2+1) \\ _Michael B. Porter_, Mar 20 2010
%o A005574 (PARI) for(n=1, 1e3, if(isprime(n^2 + 1), print1(n, ", "))) \\ _Altug Alkan_, Oct 14 2015
%o A005574 (Magma) [n: n in [0..400] | IsPrime(n^2+1)]; // _Vincenzo Librandi_, Nov 18 2010
%o A005574 (Haskell)
%o A005574 a005574 n = a005574_list !! (n-1)
%o A005574 a005574_list = filter ((== 1) . a010051' . (+ 1) . (^ 2)) [0..]
%o A005574 -- _Reinhard Zumkeller_, Jul 03 2015
%o A005574 (Python) from sympy import isprime; [print(n, end = ', ') for n in range(1, 400) if isprime(n*n+1)] # _Ya-Ping Lu_, Apr 23 2025
%Y A005574 Cf. A002522, A001912, A002496, A062325, A090693, A000068, A006314, A006313, A006315, A006316, A056994, A056995, A057465, A057002, A088361, A088362, A226528, A226529, A226530, A251597, A253854, A244150, A243959, A321323.
%Y A005574 Other sequences of the type "Numbers k such that k^2 + i is prime": this sequence (i=1), A067201 (i=2), A049422 (i=3), A007591 (i=4), A078402 (i=5), A114269 (i=6), A114270 (i=7), A114271 (i=8), A114272 (i=9), A114273 (i=10), A114274 (i=11), A114275 (i=12).
%Y A005574 Cf. A010051, A259645, A295405 (characteristic function).
%K A005574 nonn,easy,nice
%O A005574 1,2
%A A005574 _N. J. A. Sloane_