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

A239415 Numbers n such that n^7-7 is prime.

Original entry on oeis.org

60, 66, 132, 212, 242, 246, 290, 296, 312, 326, 380, 384, 446, 516, 524, 554, 654, 704, 740, 782, 834, 1026, 1086, 1142, 1154, 1172, 1182, 1214, 1424, 1430, 1464, 1482, 1494, 1500, 1524, 1604, 1682, 1686, 1752, 1794, 1796, 1844, 1854, 1940, 1952, 1980, 2000, 2010
Offset: 1

Views

Author

Derek Orr, Mar 17 2014

Keywords

Comments

Note that all the numbers in this sequence are even.

Examples

			60^7-7 = 2799359999993 is prime. Thus, 60 is a member of this sequence.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[2500],PrimeQ[#^7-7]&] (* Harvey P. Dale, Dec 21 2022 *)
  • Python
    import sympy
    from sympy import isprime
    {print(n) for n in range(10**4) if isprime(n**7-7)}

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

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

A382246 Smallest number k such that k^n - 6 is prime.

Original entry on oeis.org

8, 3, 2, 5, 5, 5, 19, 85, 7, 5, 19, 275, 23, 43, 53, 455, 65, 23, 23, 175, 7, 65, 47, 295, 7, 143, 49, 115, 23, 355, 185, 305, 7, 55, 319, 85, 113, 25, 329, 505, 25, 187, 205, 25, 295, 437, 17, 2285, 7, 583, 35, 1375, 5, 7, 35, 895, 235, 277, 197, 695, 203, 145, 43, 35, 437, 215
Offset: 1

Views

Author

Jakub Buczak, Mar 19 2025

Keywords

Comments

No term k in the sequence can be divisible by 2 or 3. Except for the special case a(1)-a(3), where the result of k^n - 6 is either the prime number 2 or 3.
If n is a multiple of 4, the only valid terms of k are those ending in a 5.
Empirical analysis suggests that the terms are typically prime or semiprime.

Examples

			a(1) = 8, because 8^1 - 6 = 2, which is prime.
a(4) = 5, because 5^4 - 6 = 619, which is prime.
		

Crossrefs

Cf. A028879 (a(2)), A239414 (a(6)) for the first term.

Programs

  • PARI
    a(n) = my(k=1); while (!isprime(k^n-6), k++); k; \\ Michel Marcus, Mar 19 2025
  • Python
    from sympy import isprime
    def a(n):
        k = 1
        while (n>1 and k not in [2,3] and (k%2==0 or k%3==0)) or not isprime(k**n-6):
            k += 1
        return k
    

A239429 Numbers n such that n^6+6 and n^6-6 are prime.

Original entry on oeis.org

175, 12635, 18445, 30275, 32585, 38885, 41125, 46235, 53165, 71785, 74935, 92645, 108115, 117775, 121625, 146125, 151655, 173635, 184765, 191765, 196175, 204505, 208705, 229775, 237965, 241255, 243635, 246365, 283115, 335755, 344365, 345485, 352625, 353395, 354445
Offset: 1

Views

Author

Derek Orr, Mar 20 2014

Keywords

Comments

All numbers are congruent to 35 mod 70.
Intersection of A109836 and A239414.

Examples

			175^6+6 = 28722900390631 is prime and 175^6-6 = 28722900390619 is prime. Thus, 175 is a member of this sequence.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[35,360000,70],AllTrue[#^6+{6,-6},PrimeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Nov 22 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(6)

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.

A380905 Smallest number k such that k^(2*3^n) - 6 is prime.

Original entry on oeis.org

3, 5, 23, 7, 433, 2447, 9377, 82597, 134687
Offset: 0

Views

Author

Jakub Buczak, Feb 07 2025

Keywords

Comments

Terms must have an ending digit of 3, 5 or 7. If k ends in 1 or 9, then k^(2*3^n)-6 ends in a 5, which is not prime.
a(7) is the first composite term. - Michael S. Branicky, Feb 24 2025

Examples

			For n=0, k^(2*3^0) - 6 is prime for the first time at a(0) = k = 3.
For n=5, k^(2*3^5) - 6 is prime for the first time at a(5) = k = 2447.
		

Crossrefs

Cf. Subsequence of A382246.
Cf. A028879 (a(0)), A239414 (a(1)) for the first term.

Programs

  • PARI
    a(n) = my(p=3,q=2*3^n); while (!ispseudoprime(p^q-6), p+=2); p; \\ Michel Marcus, Feb 08 2025
  • Python
    from sympy import isprime
    from itertools import count
    def a(n): return next(k for k in count(2) if k%10 in {3,5,7} and isprime(k**(2*3**n)-6))
    

Extensions

a(7) from Michael S. Branicky, Feb 24 2025
a(8) from Georg Grasegger, Apr 17 2025

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.
Showing 1-9 of 9 results.