login
A228424
Primes that can be written as a sum of a triangular number and a square.
3
2, 3, 5, 7, 11, 17, 19, 29, 31, 37, 53, 59, 61, 67, 71, 79, 101, 103, 107, 109, 127, 131, 137, 149, 157, 179, 191, 197, 199, 211, 239, 241, 251, 257, 269, 271, 277, 311, 317, 331, 347, 349, 353, 359, 367, 379, 389, 397, 401, 409, 421, 431, 439, 449, 479, 487, 491, 499, 509, 521
OFFSET
1,1
COMMENTS
This sequence is interesting because of the conjecture in the comments in A228425.
Note that the sequence contains all primes of the form x^2 + 1 (A002496) since 1 is a triangular number.
LINKS
Soumya Bhattacharya and Habibur Rahaman, Primes and polygonal numbers, arXiv:2408.13650 [math.NT]
FORMULA
Bhattacharya & Rahaman prove that a(n) ≍ n (log n)^(3/2). - Charles R Greathouse IV, Aug 28 2024
EXAMPLE
a(1) = 2 since 2 = 1*(1+1)/2 + 1^2.
a(2) = 3 since 3 = 2*(2+1)/2 + 0^2.
MATHEMATICA
TQ[n_]:=IntegerQ[Sqrt[8n+1]]
n=0
Do[Do[If[TQ[Prime[k]-x^2], n=n+1; Print[n, " ", Prime[k]]; Goto[aa]], {x, 0, Sqrt[Prime[k]]}];
Label[aa]; Continue, {k, 1, 100}]
PROG
(PARI) istrg(n) = {if (! issquare(8*n+1), return (0)); return (1); }
isok(p) = {for (i = 0, sqrtint(p), if (istrg(p-i^2), return (1)); ); }
lista(nn) = {forprime(p=2, nn, if (isok(p), print1(p, ", ")); ); }
(PARI) list(lim)=my(v=List(if(lim<3, [], [3]))); for(m=1, (sqrtint((lim\=1)*8+1)-1)\2, my(t=m*(m+1)/2); for(s=1, sqrtint(lim-t), my(p=t+s^2); if(isprime(p), listput(v, p)))); Set(v) \\ Charles R Greathouse IV, Aug 28 2024
CROSSREFS
Subsequence of A014133. Subsequences include A002496, A049423, A056909, A138355, and A243450.
Sequence in context: A089084 A262835 A258261 * A347192 A335325 A189828
KEYWORD
nonn,changed
AUTHOR
Zhi-Wei Sun, Nov 10 2013
STATUS
approved