OFFSET
1,1
COMMENTS
To test if a prime p is a member, p = n^2+n+q gives a finite list of possible pairs (n,q), and, for each value of q, m^2+m = p+q determines a putative value of m. - N. J. A. Sloane, Jul 17 2009
Also, primes of the form (p^2+3)/4 with p odd prime. - Zak Seidov, May 10 2014
LINKS
Jean-François Alcover, Table of n, a(n) for n = 1..77
EXAMPLE
7 = 1^2+1+5 = 3^2+3-5.
MAPLE
isA002378 := proc(n) if n >= 0 then if issqr(4*n+1) then RETURN(type( sqrt(4*n+1), 'odd')) ; else false; fi; else false; fi; end: # primes p such there is a prime q<p such that # p+q and p-q are both oblong numbers. isA162652 := proc(p) local j, q; if isprime(p) then for j from 1 do q := ithprime(j) ; if q >= p then break; fi; if isA002378(p+q) and isA002378(p-q) then RETURN(true) ; fi; od: false ; else false; fi; end: for n from 1 to 4000 do if isA162652(ithprime(n)) then printf("%d, ", ithprime(n)) ; fi; od; # R. J. Mathar, Jul 17 2009
MATHEMATICA
sol[p_] := m^2 + m - p /. Solve[m>0 && n>0 && 2p == m + m^2 + n + n^2, {m, n}, Integers];
Reap[For[p = 2, p < 10^6, p = NextPrime[p], qsel = Select[sol[p], PrimeQ]; If[qsel != {}, Print[p]; Sow[p]]]][[2, 1]] (* Jean-François Alcover, Mar 25 2020 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Daniel Tisdale, Jul 08 2009
EXTENSIONS
Definition revised by N. J. A. Sloane, Jul 17 2009
More terms from R. J. Mathar, Jul 17 2009
Extended beyond a(31) by R. J. Mathar, Feb 05 2010
STATUS
approved