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.

A097792 Numbers of the form 4k^4 or (kp)^p for prime p > 2 and k = 1, 2, 3, ....

Original entry on oeis.org

4, 27, 64, 216, 324, 729, 1024, 1728, 2500, 3125, 3375, 5184, 5832, 9261, 9604, 13824, 16384, 19683, 26244, 27000, 35937, 40000, 46656, 58564, 59319, 74088, 82944, 91125, 100000, 110592, 114244, 132651, 153664, 157464, 185193, 202500, 216000
Offset: 1

Views

Author

T. D. Noe, Aug 24 2004

Keywords

Comments

A result of Vahlen shows that the polynomial x^n + n is reducible over the integers for n in this sequence and no other n.

Crossrefs

Cf. A093324 (least k such that n^k+k is prime), A097764 (numbers of the form (kp)^p).

Programs

  • Mathematica
    nMax=500000; lst={}; k=1; While[4k^4<=nMax, AppendTo[lst, 4k^4]; k++ ]; n=2; While[p=Prime[n]; p^p<=nMax, k=1; While[(k*p)^p<=nMax, AppendTo[lst, (k*p)^p]; k++ ]; n++ ]; Union[lst]
  • PARI
    upto(n) = {my(res = List()); for(i = 1, sqrtnint(n \ 4, 4), listput(res, 4*i^4) ); forprime(p = 3, log(n), pp = p^p; for(k = 1, sqrtnint(n \ pp, p), listput(res, pp * k ^ p); ) ); listsort(res); res } \\ David A. Corneth, Jan 12 2019
    
  • PARI
    select( {is_A097792(n, p=0)= n%4==0 && ispower(n\4,4) || ((2 < p = ispower(n,,&n)) && if(isprime(p), n%p==0, foreach(factor(p)[,1], q, q%2 && n%q==0 && return(1))))}, [1..10^4]) \\ M. F. Hasler, Jul 07 2024
    
  • Python
    from sympy import isprime, perfect_power, primefactors
    def is_A097792(n):
        return n%4==0 and (perfect_power(n//4,[4]) or n==4) or (
            p := perfect_power(n)) and p[1] > 2 and (p[0]%p[1]==0 if isprime(p[1])
            else any(p[0]%q==0 for q in primefactors(p[1]) if q > 2))
    # M. F. Hasler, Jul 07 2024

Formula

Is a(n) ~ c * n^3? - David A. Corneth, Jan 12 2019

A084047 Smallest prime p such that p - n is an n-th power, or 0 if no such number exists; i.e., smallest prime of the form k^n + n.

Original entry on oeis.org

2, 3, 11, 5, 37, 7, 268435463, 6569, 521, 11, 36028797018963979, 13, 859935929762876868984659981, 4807339234680508004200143948920808143, 32783, 17, 30491346729331195921, 19, 32064977213018365645815827, 147808829414345923316083210206383297621
Offset: 1

Views

Author

Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), May 26 2003

Keywords

Comments

A072883 is the main entry for the problem of finding the smallest prime of the form k^n + n: many such k (up to n = 750 and beyond) are listed in the b-file there, but the corresponding primes are too large to list more of them here. - M. F. Hasler, Jul 07 2024

Examples

			a(2) = 3 = 1^2 + 2; a(4) = 5 = 1^4 + 4; a(6) = 7 = 1^6 + 6.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := f[n] = Module[{m=1}, While[!PrimeQ[m^n + n], m++]; Return[m^n + n]]; (* from Barry Carter in r/OEIS, May 08 2023, cf. link. - M. F. Hasler, Jul 07 2024 *)
  • PARI
    A084047(n, k=A072883(n))=if(k, k^n + n, 0) \\ M. F. Hasler, Jul 07 2024

Formula

In general, if n+1 is prime, then a(n) = n + 1 = 1^n + n.
a(n) = A072883(n)^n + n if A072883(n) is not 0, otherwise 0. - Michel Marcus, Mar 27 2020

Extensions

Corrected and extended by Ray Chandler, Jun 16 2003
One more term from Michel Marcus, Mar 27 2020

A303121 Least k>1 such that k^n + n is prime, 0 if no such k exists.

Original entry on oeis.org

2, 3, 2, 0, 2, 175, 16, 3, 2, 539, 32, 221, 118, 417, 2, 85, 14, 133, 22, 81, 76, 115, 12, 55, 28, 15, 0, 2465, 110, 31, 232, 117, 230, 3, 12, 851, 4, 375, 2, 1599, 48, 5461, 46, 15, 218, 6815, 78, 7, 100, 993, 28, 901, 624, 13, 252, 183, 226, 43247, 104, 5063, 1348, 777, 1294, 0, 1806
Offset: 1

Views

Author

Hugo Pfoertner, Apr 23 2018

Keywords

Comments

The values of n for which k^n + n is reducible over the integers are given in A097792. - Joseph Myers, Allan C. Wechsler Apr 16 2018

Examples

			a(2) = 3 because 3^2 + 3 = A303122(2) = 11 is prime, whereas 2^2 + 2 = 6 is composite.
		

Crossrefs

Formula

If n + 1 is composite, then a(n) = A072883(n). - Altug Alkan, Apr 23 2018

A130827 Least k >= 1 such that k^n + n is semiprime, or 0 if no such k exists.

Original entry on oeis.org

3, 2, 1, 3, 1, 7, 3, 1, 1, 11, 2, 7, 1, 1, 7, 3, 5, 23, 4, 1, 1, 3, 2, 1, 1, 21, 14, 11, 12, 7, 16, 1, 1, 1, 26, 37, 1, 1, 4, 21, 6, 31, 4, 25, 1, 71, 14, 1, 10, 1, 10, 371, 36, 1, 3, 1, 1, 185, 2, 43, 1, 49, 104, 1, 18, 205, 70, 1, 2, 33, 38, 541, 1, 105, 8, 1, 24, 395, 30, 3, 1, 71, 20, 1, 1, 1
Offset: 1

Views

Author

Zak Seidov, Aug 18 2007

Keywords

Comments

There exist values of n for which k^n + n is never prime (cf. A072883). Do there exist values of n for which k^n + n is never semiprime?
Compare with A361803, the equivalent sequence for k^n - n, where a generalized factorization (effectively a polynomial factorization) into 3 factors is given to show that k^n - n is never semiprime for certain n. - Peter Munn, Jun 19 2023

Examples

			a(1)=3 because 1^1 + 1 = 2 (prime) and 2^1 + 1 = 3 (prime) but 3^1 + 1 = 4 = 2*2 (semiprime).
a(2)=2 because 1^2 + 2 = 3 (prime) but 2^2 + 2 = 6 = 2*3 (semiprime).
a(3)=1 because 1^3 + 3 = 4 = 2*2 (semiprime).
a(4)=3 because 1^4 + 4 = 5 (prime) and 2^4 + 4 = 20 = 2^2 * 5 but 3^4 + 4 = 85 = 5*17 (semiprime).
a(5)=1 because 1^5 + 5 = 6 = 2*3 (semiprime).
		

Crossrefs

Cf. A097792 (n such that x^n+n is reducible), A072883 (least k >= 1 such that k^n+n is prime, or 0 if no such k exists).
Cf. A361803.

Programs

  • PARI
    a(n) = my(k=1); while (bigomega(k^n+n)!=2, k++); k; \\ Michel Marcus, Jun 19 2023

Extensions

More terms from Sean A. Irvine, Oct 20 2009

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.

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