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.

A228175 Least positive k such that n^n * k^k + 1 is a prime, or 0 if no such k exists.

Original entry on oeis.org

1, 1, 1, 2, 1, 6, 5, 2, 7, 10, 8
Offset: 0

Views

Author

Alex Ratushnyak, Nov 02 2013

Keywords

Comments

The next terms after the missing a(11) are 31, 58, 4, 596, 3.
a(11) > 20000 or a(11) = 0, a(17) = 4308, a(18) = 1073, a(19) > 20000 or a(19) = 0. - Jason Yuen, May 21 2024
a(11) > 10^5 or a(11) = 0. a(19) > 10^5 or a(19) = 0. - Jason Yuen, Feb 27 2025

Examples

			3^3 * 1 + 1 = 28 is not a prime, 3^3 * 2^2 + 1 = 109 is a prime, so a(3) = 2.
		

Crossrefs

Programs

  • Java
    import java.math.BigInteger;
    public class A228175 {
      public static void main (String[] args) {
        for (int n = 0; n < 333; n++) {
          BigInteger nn = BigInteger.valueOf(n).pow(n);
          int k = 1;
          for (; k<10000; k++) {
            BigInteger kk = BigInteger.valueOf(k).pow(k).multiply(nn).add(BigInteger.ONE);
            if (kk.isProbablePrime(80)) {
              System.out.printf("%d, ", k);
              break;
            }
          }
          if (k==10000) System.out.printf("- ");
        }
      }
    }
    
  • PARI
    A228175(n,L=9e9,s=1)={forstep(k=s+(bittest(n,0)&&n>1&&bittest(s,0)), L, 1+bittest(n,0), ispseudoprime(n^n*k^k+1)&&return(k))} \\ Optional args allow specification of start and limit for search; for odd n > 1, only check even k. - M. F. Hasler, Nov 03 2013

Formula

a(n) = A231119(n^n). - Jason Yuen, Nov 15 2024