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.

A235986 Numbers n such that two of the primes between n^2 and (n+1)^2 add up to n^2+(n+1)^2 - 1.

This page as a plain text file.
%I A235986 #16 Jul 08 2025 10:39:17
%S A235986 2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20,21,22,23,24,25,26,27,28,
%T A235986 29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,47,48,49,50,51,52,
%U A235986 53,54,55,56,57,59,60
%N A235986 Numbers n such that two of the primes between n^2 and (n+1)^2 add up to n^2+(n+1)^2 - 1.
%C A235986 Up to 10^6, the numbers missing from the sequence are 1, 17, 19, 46, 58, 64, 67, 85, and 367. - _Giovanni Resta_, Feb 26 2014
%e A235986 For n=2 n+1=3; primes between 4 and 9 are (5,7);4+9-1=12 and 5+7=12.
%e A235986 For n=3 n+1=4; primes between 9 and 16 are (11,13); 9+16-1=24 and 11+13=24.
%e A235986 For n=18 n+1=19; primes between 324 and 361 are (331,337,347,349,353,359);324+361-1=684 and 331+353=684.
%t A235986 ok[n_] := n>1 && Catch@Block[{p = NextPrime[n^2]}, While[p < (n+1)^2, If[PrimeQ[ 2*n*(n+1) - p], Throw@True, p = NextPrime@p]]; False]; Select[Range@100, ok] (* _Giovanni Resta_, Feb 26 2014 *)
%o A235986 (PARI) buildp(n) = {my(vp = []); forprime(p = n^2, (n+1)^2, vp = concat(vp, p);); vp;}
%o A235986 issum(vp, n) = {my(summ = n^2+(n+1)^2 - 1); for (i = 1, #vp, for (j = i+1, #vp, if (vp[i]+vp[j] == summ, return (1)););); return (0);}
%o A235986 isok(n) = my(vp = buildp(n)); issum(vp, n); \\ _Michel Marcus_, Jan 18 2014
%Y A235986 Cf. A000290, A046092.
%K A235986 nonn
%O A235986 1,1
%A A235986 _César Aguilera_, Jan 17 2014