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.

A219782 Number of ways to write n=x+y (0 with n^2-xy and n^2+xy both prime.

This page as a plain text file.
%I A219782 #12 Jul 23 2025 00:40:33
%S A219782 0,1,1,1,1,1,1,0,2,0,1,1,3,2,3,1,1,0,2,0,2,1,3,1,2,1,3,2,4,2,2,1,1,2,
%T A219782 4,2,3,2,4,3,0,1,2,2,1,0,4,1,4,1,6,2,1,2,6,1,3,0,1,3,5,2,7,2,1,2,4,1,
%U A219782 3,3,5,2,1,2,2,2,4,0,3,1,5,2,4,3,2,3,2,3,2,1,4,3,3,2,3,2,7,1,5,5
%N A219782 Number of ways to write n=x+y (0<x<=y) with n^2-xy and n^2+xy both prime.
%C A219782 Conjecture: a(n)>0 if n is not among 1, 8, 10, 18, 20, 41, 46, 58, 78, 116, 440.
%C A219782 Zhi-Wei Sun also made the following general conjecture:
%C A219782 For any k=0,1,2,4,5,6,... and positive odd integer m, each sufficiently large integer n can be written as x+y (0<x<=y) with |m*n^k-xy| and |m*n^k+xy| all prime.
%C A219782 For example, if n>6 is different from 24 then n can be written as x+y with x,y positive, and xy-n and xy+n both prime; if n>308 then n can be written as x+y with x,y positive, and 3n^2-xy and 3n^2+xy both prime.
%H A219782 Zhi-Wei Sun, <a href="/A219782/b219782.txt">Table of n, a(n) for n = 1..10000</a>
%H A219782 Zhi-Wei Sun, <a href="http://arxiv.org/abs/1211.1588">Conjectures involving primes and quadratic forms</a>, arXiv:1211.1588.
%e A219782 a(9)=2 since 9=1+8=4+5 with 9^2+1*8, 9^2-1*8, 9^2+4*5, 9^2-4*5 all prime.
%t A219782 a[n_]:=a[n]=Sum[If[PrimeQ[n^2-k(n-k)]==True&&PrimeQ[n^2+k(n-k)]==True,1,0],{k,1,n/2}]
%t A219782 Do[Print[n," ",a[n]],{n,1,10000}]
%Y A219782 Cf. A091182, A218585, A218654.
%K A219782 nonn
%O A219782 1,9
%A A219782 _Zhi-Wei Sun_, Nov 27 2012