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.

Previous Showing 11-14 of 14 results.

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.

A241427 Smallest prime of the form n^k - k^n for some k, or 0 if no such prime exists.

Original entry on oeis.org

7, 2, 3, 6102977801, 5, 79792265017612001, 7, 2486784401
Offset: 2

Views

Author

Derek Orr, Aug 08 2014

Keywords

Comments

Conjecture: a(n) > 0 for all n not in A097764.
More terms in b-file. If n > 4 and in A097764, n^k - k^n is factorable and won't be prime.
a(17) > 17^7500 - 7500^17. See A239279.

Crossrefs

Cf. A078201.

Programs

  • PARI
    a(n)=k=1;if(n>4,forprime(p=1,100,if(ispower(n)&&ispower(n)%p==0&&n%p==0,return(0));if(n%p==n,break)));k=1;while(!ispseudoprime(n^k-k^n),k++);return(n^k-k^n)
    vector(15, n, a(n+1))

A097794 Least k such that the absolute value of k^n-n is prime or zero if no such k exists.

Original entry on oeis.org

3, 2, 1, 1, 4, 1, 60, 1, 2, 21, 28, 1, 2, 1, 28, 0, 234, 1, 2, 1, 2, 159, 10, 1, 68, 145, 0, 69, 186, 1, 32, 1, 26, 261, 4, 0, 8, 1, 62, 3, 22, 1, 6, 1, 8, 945, 76, 1, 116, 129, 382, 93, 330, 1, 2, 555, 224, 1359, 78, 1, 62, 1, 110, 0, 1032, 37, 462, 1, 100, 9, 88, 1, 1416, 1, 218
Offset: 1

Views

Author

T. D. Noe, Aug 24 2004

Keywords

Comments

Because the polynomial x^n - n is reducible for n in A097764, a(n) is 0 for n=16, 27, 36, 64, 100,.... Although x^4-4 is reducible, the factor x^2-2 is -1 for x=1.

Crossrefs

Cf. A097764 (n such that x^n-n is reducible), A072883 (least k such that k^n+n is prime).

Programs

  • Mathematica
    Table[If[MemberQ[{16, 27, 36, 64, 100}, n], 0, k=1; While[ !PrimeQ[k^n-n], k++ ]; k], {n, 100}]

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.
Previous Showing 11-14 of 14 results.