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.

A265006 Twin prime pairs of the form (k^2 + k - 1, k^2 + k + 1).

Original entry on oeis.org

5, 7, 11, 13, 29, 31, 41, 43, 71, 73, 239, 241, 419, 421, 461, 463, 599, 601, 1481, 1483, 1721, 1723, 2549, 2551, 2969, 2971, 3539, 3541, 4421, 4423, 8009, 8011, 10301, 10303, 17291, 17293, 19181, 19183, 20021, 20023, 23561, 23563, 24179, 24181, 27059, 27061, 31151, 31153, 35531, 35533
Offset: 1

Views

Author

Bill McEachen, Nov 29 2015

Keywords

Comments

This is a subset of A002327 and A002383 taken together. Note that 3 is not a member, as the pairing (3, 5) is excluded as defined, as 3 and 5 associate to different centers.
The corresponding n are in A088485.
The average of each twin prime pair is an oblong number (A002378). - Michel Marcus, Feb 04 2017

Examples

			For k = 6, k^2 + k = 6^2 + 6 = 42, and (41,43) is a twin prime pair, so 41 and 43 are in the sequence.
		

Crossrefs

Programs

  • Magma
    &cat[[n^2+n-1, n^2+n+1]: n in [0..250]| IsPrime(n^2+n-1) and IsPrime(n^2+n+1)]; // Vincenzo Librandi, Feb 05 2017
  • Mathematica
    {#^2 + # - 1, #^2 + # + 1} & /@ Select[Range@ 200, PrimeQ[#^2 + # - 1] && PrimeQ[#^2 + # + 1] &] // Flatten (* Michael De Vlieger, Nov 30 2015 *)
    Flatten[Select[Table[n^2 + n + {-1, 1}, {n, 0, 200}], And@@PrimeQ[#] &]] (* Vincenzo Librandi, Feb 05 2017 *)
  • PARI
    genit()={my(maxx=1000);n=0;while(n
    				

Formula

a(2n-1) = A088486(n). a(2n)=2+a(2n-1).

A255229 Integers n such that n^2 - 1 is the difference of the squares of twin primes.

Original entry on oeis.org

5, 7, 11, 13, 17, 31, 41, 43, 49, 77, 83, 101, 109, 119, 133, 179, 203, 263, 277, 283, 307, 311, 329, 353, 377, 407, 413, 419, 431, 437, 463, 473, 493, 577, 581, 619, 629, 703, 757, 791, 811, 907, 911, 913, 991, 1001, 1037, 1061, 1103, 1121, 1249, 1289, 1337, 1373, 1441, 1457, 1487, 1523, 1597, 1651, 1781
Offset: 1

Views

Author

Neri Gionata, Feb 18 2015

Keywords

Examples

			31^2 - 1 = 241^2 - 239^2, and (239, 241) is a twin prime pair, so 31 is in the sequence.
		

Crossrefs

Cf. A088486 (corresponding lesser twin primes), A111046.

Programs

  • Mathematica
    lst={};f[n_]:=Sqrt[Prime[n]^2-NextPrime[Prime[n],-1]^2+1];
    Do[If[Prime[n]-NextPrime[Prime[n],-1]==2&&IntegerQ[f[n]],AppendTo[lst,f[n]]],{n,3,10^5}];lst (* Ivan N. Ianakiev, Mar 30 2015 *)
  • PARI
    lista(nn) = {forprime(p=3, nn, q = precprime(p-1); if (((p-q) == 2) && issquare(d=p^2-q^2+1), print1(sqrtint(d), ", ")); ); } \\ Michel Marcus, Feb 18 2015
Showing 1-2 of 2 results.