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.

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)}
    

A239418 Numbers n such that n^10 - 10 is prime.

Original entry on oeis.org

21, 201, 267, 321, 369, 459, 537, 651, 669, 699, 723, 753, 1071, 1113, 1197, 1203, 1209, 1323, 1401, 1503, 1587, 1647, 1773, 1791, 1797, 1917, 1941, 2007, 2139, 2223, 2427, 2493, 2613, 2733, 2769, 2787, 2847, 3147, 3249, 3267, 3297, 3399, 3423, 3441, 3771
Offset: 1

Views

Author

Derek Orr, Mar 17 2014

Keywords

Comments

All of the numbers in this sequence are odd multiples of 3 and, thus, congruent to 3 (mod 6).
The tenth powers modulo 6 are 1, 4, 3, 4, 1, 0, ... (A070431). Subtracting 10 (still modulo 6), we get 3, 0, 5, 0, 3, 2, ... which means that only n = 3 mod 6 can produce a potential prime p = 5 mod 6.

Examples

			21^10 - 10 = 16679880978191 is prime. Thus, 21 is a member of this sequence.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[1000], PrimeQ[#^10 - 10] &] (* Alonso del Arte, Mar 18 2014 *)
  • PARI
    is(n)=isprime(n^10-10) \\ 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**10-10)}
    

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.

A239503 Numbers n such that n^8+8 and n^8-8 are prime.

Original entry on oeis.org

3, 1515, 1689, 3327, 4461, 4641, 4965, 5043, 5583, 5709, 6183, 7089, 9291, 9369, 9699, 10125, 11109, 14175, 15081, 18393, 20295, 26955, 27009, 27219, 29067, 30513, 30807, 35355, 35889, 36003, 37935, 40107, 43461, 48045, 49005, 51783, 53289, 55527, 58833, 61203
Offset: 1

Views

Author

Derek Orr, Mar 20 2014

Keywords

Comments

All numbers are congruent to 3 mod 6.
Intersection of A239345 and A239416.

Examples

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

Crossrefs

Programs

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