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.

A346154 a(n) is the least prime of the form n^k+n+1 with k>1, or 0 if there is no such prime.

Original entry on oeis.org

3, 7, 13, 0, 31, 43, 0, 73, 739, 0, 14653, 157, 0, 211, 241, 0, 307, 5851, 0, 421, 463, 0, 1801152661487, 601, 0, 457003, 757, 0, 24419, 27031, 0, 32801, 1123, 0, 144884079282928466796911, 1679653, 0, 1483, 59359, 0, 1723, 74131, 0, 85229, 8303765671, 0, 4879729, 110641, 0, 2551, 2334165173090503
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Jul 07 2021

Keywords

Comments

a(n) = 0 if n == 1 (mod 3) and n > 1.
Conjecture: a(n) > 0 otherwise.

Examples

			a(9) = 739 because 9^3 + 9 + 1 = 739 is prime while 9^2 + 9 + 1 is not.
		

Crossrefs

Cf. A346149.

Programs

  • Maple
    f:= proc(n) local i;
    if n mod 3 = 1 then return 0 fi;
    for i from 2 do if isprime(n^i+n+1) then return n^i+n+1 fi od:
    end proc:
    f(1):= 3:
    map(f, [$1..100]);
  • Python
    from sympy import isprime
    def a(n):
        if n > 1 and n%3 == 1: return 0
        k = 2
        while not isprime(n**k + n + 1): k += 1
        return n**k + n + 1
    print([a(n) for n in range(1, 52)]) # Michael S. Branicky, Jul 07 2021

Formula

a(n) = n^A346149(n) + n + 1 if A346149(n) > 0.