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.

A240842 Numbers n such that n - 2*k^2 is a prime for all k > 0 with k^2 < n/2.

This page as a plain text file.
%I A240842 #19 May 10 2014 11:50:32
%S A240842 1,2,4,5,7,13,15,21,25,31,49,55,61,91,181,199
%N A240842 Numbers n such that n - 2*k^2 is a prime for all k > 0 with k^2 < n/2.
%C A240842 No other terms found for n < 2000000. - _Colin Barker_, Apr 13 2014
%C A240842 No other terms with n < 10^17. - _Charles R Greathouse IV_, Apr 14 2014
%C A240842 All terms > 4 must be odd, since otherwise n - 2*1^2 is composite. The initial terms 1 and 2 satisfy the condition voidly (no k^2 < n/2 exists). They could be excluded explicitly, but including them can only improve search results. - _M. F. Hasler_, Apr 16 2014
%e A240842 91 is in this sequence because 91-2*1^2 = 89, 91-2*2^2 = 83, 91-2*3^2 = 73, 91-2*4^2 = 59, 91-2*5^2 = 41, 91-2*6^2 = 19 where 89, 83, 73, 59, 41, 19 are all primes.
%o A240842 (PARI) isOK(n) = k=1; until(k^2>=n/2, if(!isprime(n-2*k^2), return(0)); k++); 1;
%o A240842 for(n=1, 20000, if(isOK(n), print1(n, ", "))) \\ _Colin Barker_, Apr 14 2014
%Y A240842 Cf. A039669.
%K A240842 nonn
%O A240842 1,2
%A A240842 _Ilya Lopatin_ and _Juri-Stepan Gerasimov_, Apr 13 2014