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.

Showing 1-2 of 2 results.

A284036 Positive integers n such that (n^2 - 3)/2 and (n^2 + 1)/2 are twin primes.

Original entry on oeis.org

3, 5, 11, 19, 25, 29, 65, 79, 101, 205, 209, 221, 245, 275, 289, 299, 349, 371, 409, 415, 449, 521, 535, 569, 571, 575, 595, 649, 661, 695, 739, 781, 791, 935, 949, 991, 1081, 1091, 1099, 1129, 1181, 1225, 1241, 1285, 1345, 1349, 1459, 1489, 1531, 1541, 1615
Offset: 1

Views

Author

Giuseppe Coppoletta, Mar 27 2017

Keywords

Comments

All terms are obviously odd.

Examples

			25 is a term because (25^2 - 3)/2 = 311 and (25^2 + 1)/2 = 313 are twin primes.
		

Crossrefs

Programs

  • Maple
    filter:= n -> isprime((n^2-3)/2) and isprime((n^2+1)/2):
    select(filter, [seq(i,i=1..2000,2)]); # Robert Israel, Apr 24 2017
  • Mathematica
    Select[Range[1, 1285, 2], Times @@ Boole@ Map[PrimeQ, (#^2 + {-3, 1})/2] == 1 &] (* Michael De Vlieger, Mar 28 2017 *)
  • PARI
    isok(n) = isprime((n^2 - 3)/2) && isprime((n^2 + 1)/2); \\ Michel Marcus, Apr 04 2017
    
  • Python
    from sympy import isprime
    print([n for n in range(3, 1700, 2) if isprime((n**2 - 3)//2) and isprime((n**2 + 1)//2)]) # Indranil Ghosh, Apr 04 2017
  • Sage
    [n for n in range(3,1700,2) if is_prime((n^2 - 3)//2) and is_prime((n^2 + 1)//2)]
    

A284035 Upper twin primes which correspond to the hypotenuse in a Pythagorean triple whose short leg is also a prime.

Original entry on oeis.org

5, 13, 61, 181, 421, 3121, 5101, 60901, 83641, 100801, 135721, 161881, 163021, 218461, 273061, 491041, 595141, 637321, 697381, 1064341, 1108561, 1171981, 1806901, 2574181, 2601481, 2740141, 2763601, 2853661, 3248701, 3535141, 3567121, 3696481, 3723721, 3729181, 4832941
Offset: 1

Views

Author

Giuseppe Coppoletta, Mar 19 2017

Keywords

Comments

A284034 gives the corresponding short leg primes in the definition.

Examples

			The prime q = 3121 is in the sequence because q - 2 = 3119 is prime and {79, 3120, 3121} is a Pythagorean triple with prime short leg (see example in A284034).
		

Crossrefs

Programs

  • PARI
    lista(nn) = forprime(p=3, nn, if (isprime(p) && isprime((p^2-3)/2) && isprime(q=(p^2+1)/2), print1(q, ", "))); \\ Michel Marcus, Apr 01 2017

Formula

A284034(n)^2 + (a(n) - 1)^2 = a(n)^2, i.e., a(n) = (A284034(n)^2 + 1)/2.

Extensions

More terms from Michel Marcus, Apr 01 2017
Showing 1-2 of 2 results.