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

A239416 Numbers n such that n^8-8 is prime.

Original entry on oeis.org

3, 7, 19, 39, 73, 75, 101, 107, 145, 147, 171, 213, 235, 247, 263, 285, 319, 353, 359, 369, 399, 443, 445, 521, 523, 557, 613, 675, 693, 707, 733, 781, 791, 805, 815, 829, 837, 879, 927, 943, 961, 999, 1033, 1097, 1103, 1109, 1129, 1137, 1141, 1155, 1157
Offset: 1

Views

Author

Derek Orr, Mar 17 2014

Keywords

Comments

Note that all the numbers in this sequence are odd.

Examples

			3^8-8 = 6553 is prime. Thus, 3 is a member of this sequence.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[3,1200,2],PrimeQ[#^8-8]&] (* Harvey P. Dale, Jun 27 2014 *)
  • PARI
    is(n)=isprime(n^8-8) \\ Charles R Greathouse IV, Feb 20 2017
  • Python
    import sympy
    from sympy import isprime
    {print(n) for n in range(10**4) if isprime(n**8-8)}
    

A239417 Numbers n such that n^9-9 is prime.

Original entry on oeis.org

2, 62, 86, 88, 116, 152, 266, 292, 310, 326, 338, 356, 406, 436, 466, 470, 518, 550, 568, 616, 626, 650, 688, 700, 722, 812, 850, 926, 956, 992, 1058, 1076, 1126, 1186, 1252, 1430, 1550, 1570, 1642, 1672, 1682, 1766, 1808, 1852, 1868, 1888, 2138, 2210, 2306
Offset: 1

Views

Author

Derek Orr, Mar 17 2014

Keywords

Comments

Note that all numbers in this sequence are even.

Examples

			2^9-9 = 503 is prime. Thus, 2 is a member of this sequence.
		

Crossrefs

Programs

  • PARI
    is(n)=isprime(n^9-9) \\ Charles R Greathouse IV, Feb 20 2017
  • Python
    import sympy
    from sympy import isprime
    {print(n) for n in range(10**4) if isprime(n**9-9)}
    

A239474 Smallest k >= 1 such that k^n-n is prime. a(n) = 0 if no such k exists.

Original entry on oeis.org

3, 2, 2, 0, 4, 5, 60, 3, 2, 21, 28, 5, 2, 199, 28, 0, 234, 11, 2, 3, 2, 159, 10, 31, 68, 145, 0, 69, 186, 163, 32, 253, 26, 261, 4, 0, 8, 11, 62, 3, 22, 43, 6, 7, 8, 945, 76, 7, 116, 129, 382, 93, 330, 361, 2, 555, 224, 1359, 78, 29, 62, 39, 110, 0, 1032, 37, 462, 29
Offset: 1

Views

Author

Derek Orr, Mar 20 2014

Keywords

Comments

If n is of the form (pk)^p for some k and some prime p, then a(n) = 0 (See A097764).

Examples

			1^1-1 = 0 is not prime. 2^1-1 = 1 is not prime. 3^1-1 = 2 is prime. Thus, a(1) = 3.
		

Crossrefs

Programs

  • Python
    import sympy
    from sympy import isprime
    def TwoMin(x):
      for k in range(1,5000):
        if isprime(k**x-x):
          return k
    x = 1
    while x < 100:
      print(TwoMin(x))
      x += 1

Formula

a(A097764(n)) = 0 for all n.

A239475 Least number k such that k^n + n and k^n - n are both prime, or 0 if no such number exists.

Original entry on oeis.org

4, 3, 2, 0, 42, 175, 66, 3, 2, 4983, 1770, 55055, 28686, 18765, 8456, 0, 594, 128345, 136080, 81, 92, 1163409, 18810, 10415, 11754, 3855, 0, 86043, 38880, 17639, 26088, 37293, 5540, 612015, 6876, 0, 44220, 130425, 110, 9292527, 1004850, 1812149, 442404, 1007445, 570658
Offset: 1

Views

Author

Derek Orr, Mar 20 2014

Keywords

Comments

a(n) = 0 iff n is of the form (pk)^p for some k and some prime p (See A097764).
gcd(n,a(n)) = 1 for all a(n) > 0.

Examples

			1^1 +/- 1 = 2 and 0 are not both primes. 2^1 +/- 1 = 3 and 1 are not both primes. 3^1 +/- 1 = 4 and 2 are not both primes. 4^1 +/- 1 = 5 and 3 are both primes. Thus a(1) = 4.
		

Crossrefs

Programs

  • PARI
    a(n)=for(k=1,10^7,if(ispseudoprime(k^n-n)&&ispseudoprime(k^n+n),return(k)))
    n=1;while(n<100,print1(a(n),", ");n++)
  • Python
    import sympy
    from sympy import isprime
    def TwoBoth(x):
      for k in range(1,10**7):
        if isprime(k**x+x) and isprime(k**x-x):
          return k
    x = 1
    while x < 100:
      if TwoBoth(x) != None:
        print(TwoBoth(x))
      else:
        print(0)
      x += 1
    

Formula

a(A097764(n)) = 0 for all n.

A239506 Numbers n such that n^10+10 and n^10-10 are prime.

Original entry on oeis.org

4983, 105369, 113289, 150051, 191829, 208131, 277167, 305349, 363957, 400323, 494241, 541233, 577269, 656271, 668547, 995247, 1141503, 1218261, 1360623, 1494537, 1501863, 1528857, 1531959, 1534533, 1535919, 1621653, 1651551, 1864863, 1950597, 1969539, 2130513
Offset: 1

Views

Author

Derek Orr, Mar 20 2014

Keywords

Comments

All numbers are congruent to 33 mod 66.
Intersection of A239347 and A239418.

Examples

			4983^10+10 = 9438628041688305771192954743294050459 is prime and 4983^10-10 = 9438628041688305771192954743294050439 is prime. Thus, 4983 is a member of this sequence.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[22*10^5],AllTrue[#^10+{10,-10},PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jan 04 2018 *)
  • Python
    import sympy
    from sympy import isprime
    def TwoBoth(x):
      for k in range(10**8):
        if isprime(k**x+x) and isprime(k**x-x):
          print(k)
    TwoBoth(10)
Showing 1-5 of 5 results.