login
Primes of the form 8k+5 generated recursively: a(1)=5, a(n) = least prime p == 5 (mod 8) with p | 4+Q^2, where Q is the product of all previous terms in the sequence.
25

%I #28 Jul 14 2018 02:44:04

%S 5,29,1237,32171803229,829,405565189,14717,

%T 39405395843265000967254638989319923697097319108505264560061,

%U 282860648026692294583447078797184988636062145943222437,53,421,13,109,4133,6476791289161646286812333,461,34549,453690033695798389561735541

%N Primes of the form 8k+5 generated recursively: a(1)=5, a(n) = least prime p == 5 (mod 8) with p | 4+Q^2, where Q is the product of all previous terms in the sequence.

%D G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, page 13.

%H P. G. L. Dirichlet, <a href="https://archive.org/stream/vorlesungenberz04dedegoog#page/n361/mode/2up">Supplement VI: Beweis des Satzes, dass jede unbegrenzte arithmetische Progression, deren erstes Glied und Differenz ganze Zahlen ohne gemeinschaftlichen Factor sind, unendlich viele Primzahlen enthält</a>, Vorlesungen uber Zahlentheorie. Braunschweig, Viewig, 1871, 24 pages.

%e a(3) = 1237 = 8*154 + 5 is the smallest suitable prime divisor of (5*29)*5*29 + 4 = 21029 = 17*1237. (Although 17 is the smallest prime divisor, 17 is not congruent to 5 modulo 8.)

%t a={5}; q=1;

%t For[n=2,n<=7,n++,

%t q=q*Last[a];

%t AppendTo[a,Min[Select[FactorInteger[4+q^2][[All,1]],Mod[#,8]==5 &]]];

%t ];

%t a (* _Robert Price_, Jul 16 2015 *)

%o (PARI) lista(nn) = {v = vector(nn); v[1] = 5; print1(v[1], ", "); for (n=2, nn, f = factor(4 + prod(k=1, n-1, v[k])^2); for (k=1, #f~, if (f[k, 1] % 8 == 5, v[n] = f[k,1]; break);); print1(v[n], ", "););} \\ _Michel Marcus_, Oct 27 2014

%Y Cf. A000945, A000946, A005265, A005266, A051308-A051335, A007521, A057204-A057208.

%K nonn

%O 1,1

%A _Labos Elemer_, Oct 09 2000

%E More terms from _Sean A. Irvine_, Oct 26 2014