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-7 of 7 results.

A128780 Numbers n such that n^k+(n+1)^k is prime for k = 1, 2, 4.

Original entry on oeis.org

1, 2, 9, 14, 189, 204, 230, 320, 680, 765, 1080, 1190, 1359, 1364, 1500, 1764, 1850, 2049, 2115, 2360, 2379, 2919, 3050, 3110, 3179, 3579, 3794, 4164, 4215, 4470, 5355, 5619, 5630, 5664, 5810, 5889, 5979, 6035, 6150, 6269, 6824, 6960, 7275, 8045, 8259
Offset: 1

Views

Author

Zak Seidov, Mar 28 2007

Keywords

Comments

n^k+(n+1)^k is prime only for k = power of 2.
There are 1242 terms < 10^6.
All terms > 2 are congruent to 0 or 4 (mod 5). - Robert Israel, Mar 29 2017

Examples

			{2+1, 2^2+3^2,2^4+3^4} = {3,13,97} all prime,
{9+10, 9^2+10^2,9^4+10^4} = {19,181,16561} all prime.
		

Crossrefs

Subset of A068501.

Programs

  • Maple
    select(n -> isprime(2*n+1) and isprime(2*n^2+2*n+1) and isprime(n^4+(n+1)^4),
    [1,2,seq(seq(5*i+j,j=[0,4]),i=1..10000)]); # Robert Israel, Mar 29 2017
  • Mathematica
    pnQ[n_]:=And@@PrimeQ/@(n^{1,2,4}+(n+1)^{1,2,4}); Select[Range[9000], pnQ]  (* Harvey P. Dale, Apr 06 2011 *)

A178659 Numbers n such that n^2 +- (n-1)^2 are primes.

Original entry on oeis.org

2, 3, 6, 10, 15, 30, 31, 36, 40, 51, 66, 70, 91, 100, 136, 175, 190, 205, 225, 231, 261, 285, 286, 316, 321, 331, 370, 376, 411, 441, 465, 496, 516, 520, 526, 535, 546, 565, 576, 586, 591, 681, 720, 730, 745, 750, 766, 855, 871, 906, 916, 951, 975, 1081, 1120
Offset: 1

Views

Author

Keywords

Examples

			2 is in the sequence because 2^2 + 1^2 = 5 and 2^2 - 1^2 = 3 are both prime.
3 is in the sequence because 3^2 + 2^2 = 13 and 3^2 - 2^2 = 5 are both prime.
		

Crossrefs

Cf. A068501.

Programs

  • Mathematica
    lst={};Do[If[PrimeQ[n^2-(n-1)^2]&&PrimeQ[n^2+(n-1)^2],AppendTo[lst,n]],{n,7!}];lst
    Select[Range[8!], PrimeQ[#^2 -(#-1)^2] && PrimeQ[#^2 +(#-1)^2] &] (* G. C. Greubel, Jan 28 2019 *)
  • PARI
    A178659()={my(maxx=1000);n=2;ptr=0;
    while(n<=maxx,q1=n^2-(n-1)^2;q2=n^2+(n-1)^2;
    if(isprime(q1)&&isprime(q2),ptr++;write("b178659.txt",ptr,"  ",n));n++); } \\ Bill McEachen, Jun 13 2014

Formula

a(n) = 1 + A068501(n). - Zak Seidov, Feb 10 2015

A127206 Numbers k such that k^j + (k+1)^j is prime for j = 1, 2, 4, 8.

Original entry on oeis.org

1, 765, 39269, 70260, 71399, 85764, 100079, 167789, 218229, 307020, 388449, 468945, 514760, 553400, 568904, 782595, 826284, 1160199, 1220430, 1403775, 1633020, 1714739, 1727930, 1788144, 1932900, 1958705, 2023119, 2037450, 2178804, 2185520, 2193969, 2238474, 2264774
Offset: 1

Views

Author

Zak Seidov, Mar 28 2007

Keywords

Comments

k^j + (k+1)^j is prime only for j = power of 2.
Subset of A128780 which is a subset of A068501.

Examples

			{765 + 766, 765^2 + 766^2, 765^4 + 766^4, 765^8 + 766^8} = {1531, 1171981, 686770904161, 235828747162526935093921}, all prime.
		

Crossrefs

Programs

  • Magma
    [n: n in [1..3*10^6]| IsPrime(2*n+1) and IsPrime(n^2+(n+1)^2) and IsPrime(n^4+(n+1)^4) and IsPrime(n^8+(n+1)^8)]; // Vincenzo Librandi, Nov 18 2018
  • Mathematica
    Do[If[PrimeQ[2n + 1] && PrimeQ[n^2 + (n+1)^2] && PrimeQ[n^4 + (n+1)^4] && PrimeQ[n^8 + (n+1)^8], Print[n]], {n, 5*10^6}] (* Ryan Propper, Mar 30 2007 *)

Extensions

More terms from Ryan Propper, Mar 30 2007

A178660 Numbers k such that k^3 +- (k+5)^2 are primes.

Original entry on oeis.org

7, 12, 13, 18, 58, 142, 187, 502, 597, 657, 702, 907, 912, 942, 943, 972, 1057, 1168, 1248, 1357, 1453, 1533, 1663, 1938, 2013, 2088, 2272, 2373, 2478, 2608, 2848, 2968, 3003, 3028, 3108, 3247, 3423, 3478, 3583, 3817, 3927, 3957, 4132, 4212, 4632, 4668
Offset: 1

Views

Author

Keywords

Examples

			7 is a term since: 7^3 +- 12^2 -> (199,487) which are primes.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[8! ],PrimeQ[ #^3-(#+5)^2]&&PrimeQ[ #^3+(#+5)^2]&]
    Select[Range[4700],AllTrue[#^3+{(#+5)^2,-(#+5)^2},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Mar 19 2018 *)

A334802 Positive integers of the form x^4 - y^4 that have exactly 4 divisors.

Original entry on oeis.org

15, 65, 671, 3439, 12209, 102719, 113521, 178991, 246559, 515201, 1124111, 1342879, 2964961, 3940399, 9951391, 21254449, 27220159, 34209169, 45259649, 48986321, 70710641, 92110289, 93084991, 125620111, 131687681, 144402721, 201792079, 211782751, 276694241
Offset: 1

Views

Author

C. Kenneth Fan, May 12 2020

Keywords

Comments

If a(n) = pq, where p > q are both prime, then p is the hypotenuse and q is a leg of a primitive Pythagorean triple. (x^4-y^4 = (x^2+y^2)(x+y)(x-y), hence x-y=1 and x^2+y^2 and x+y are both prime. Note that x^2+y^2 can never be (x+y)^2 so a(n) is never the cube of a prime.)

Examples

			2^4 - 1^4 = 15 = 3*5 and (3, 4, 5) is a Pythagorean triple, so 15 is a term.
6^4 - 5^4 = 671 = 11*61 and (11, 60, 61) is a Pythagorean triple, so 671 is a term.
		

Crossrefs

Cf. A068501.
Intersection of A030513 and A147857.

Programs

  • Maple
    f:= proc(y) if isprime(2*y+1) and isprime(2*y^2 + 2*y+1) then (2*y+1)*(2*y^2+2*y+1) fi end proc:
    map(f, [$1..1000]); # Robert Israel, Jun 16 2020
  • Mathematica
    Select[(#^4 - (#-1)^4) & /@ Range[420], DivisorSigma[0, #] == 4 &] (* Giovanni Resta, May 12 2020 *)

Formula

a(n) = (b(n)+1)^4 - b(n)^4 with b(n)=A068501(n).
a(n) = A048161(n)*A067756(n).

A173415 Numbers n such that both the difference and the sum of (n-th prime+1)^2 and (n-th prime)^2 are prime.

Original entry on oeis.org

1, 3, 10, 128, 201, 223, 246, 309, 357, 393, 424, 482, 526, 815, 887, 909, 1014, 1196, 1543, 1610, 1653, 1674, 1743, 2219, 2302, 2339, 2371, 2475, 2513, 2611, 2948, 3107, 3273, 3419, 3434, 3516, 3555, 3593, 4070, 4203, 4288, 4332, 4389, 4428, 4724, 4793
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Mar 01 2010

Keywords

Examples

			a(1)=1 because (1st prime+1)^2 - (1st prime)^2=5 is prime and (1st prime+1)^2 + (1st prime)^2=13 is prime;
a(2)=3 because (3rd prime+1)^2 - (3rd prime)^2=11 is prime and (3rd prime+1)^2 + (3rd prime)^2=61 is prime;
a(3)=10 because (10th prime+1)^2 - (10th prime)^2=59 is prime and (10th prime+1)^2 + (10th prime)^2=1741 is prime;
a(4)=128 because (128th prime+1)^2 - (128th prime)^2=1439 is prime and (128th prime+1)^2 + (128th prime)^2=1035361 is prime.
		

Crossrefs

Programs

  • Mathematica
    npsQ[n_]:=Module[{np=Prime[n],a,b},a=np^2;b=(np+1)^2;And@@PrimeQ[ {a+b,b-a}]]; Select[Range[5000],npsQ] (* Harvey P. Dale, Sep 11 2011 *)

Formula

a(n) = Pi(A098717(n)) = A049084(A098717(n)). - R. J. Mathar, Mar 09 2010

Extensions

Extended beyond a(4) by R. J. Mathar, Mar 09 2010

A254886 a(n) = least k>0 such that n-k^2 and n+k^2 are both primes.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 2, 0, 2, 0, 0, 1, 0, 3, 2, 0, 0, 1, 0, 3, 4, 3, 0, 0, 0, 0, 2, 3, 0, 1, 0, 3, 2, 0, 0, 5, 0, 3, 0, 0, 0, 1, 6, 0, 4, 0, 6, 5, 0, 3, 0, 3, 6, 5, 0, 0, 2, 0, 0, 1, 0, 3, 2, 0, 6, 0, 6, 0, 0, 3, 0, 1, 6, 0, 2, 0, 6, 5, 0, 3, 0, 0, 0, 5, 0, 9, 4, 3, 0, 7, 0, 3, 2, 0, 6, 0, 0, 3, 0, 9, 0, 1, 6, 0, 2, 0, 0, 1, 0
Offset: 1

Views

Author

Zak Seidov, Feb 10 2015

Keywords

Comments

If n is a square then a(n)=sqrt(n)-1 or 0.
Also if n is a square and a(n)=sqrt(n)-1 then sqrt(n) is a term in A178659.
First appearances of k for k=1..58 are at n = 4, 7, 14, 21, 36, 43, 90, 117, 86, 111, 210, 149, 768, 201, 236, 285, 468, 329, 366, 411, 446, 1137, 534, 647, 654, 807, 770, 885, 900, 911, 3090, 1665, 1192, 2415, 1296, 1313, 4212, 2163, 1600, 1671, 5448, 1769, 2040, 1941, 2054, 3207, 2214, 2333, 5340, 2601, 2792, 7725, 2814, 3095, 3054, 5913, 3442, 4377.
Among the first 10000 terms, the first missing values are 59, 79, 82, 83, 89, 91, 92, 94, 97, 98, 100.

Crossrefs

Programs

  • PARI
    k=1;while(k^2Derek Orr, Feb 11 2015
Showing 1-7 of 7 results.