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.

This page as a plain text file.
%I A346154 #12 Jul 08 2021 14:21:44
%S A346154 3,7,13,0,31,43,0,73,739,0,14653,157,0,211,241,0,307,5851,0,421,463,0,
%T A346154 1801152661487,601,0,457003,757,0,24419,27031,0,32801,1123,0,
%U A346154 144884079282928466796911,1679653,0,1483,59359,0,1723,74131,0,85229,8303765671,0,4879729,110641,0,2551,2334165173090503
%N 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.
%C A346154 a(n) = 0 if n == 1 (mod 3) and n > 1.
%C A346154 Conjecture: a(n) > 0 otherwise.
%H A346154 Robert Israel, <a href="/A346154/b346154.txt">Table of n, a(n) for n = 1..67</a>
%F A346154 a(n) = n^A346149(n) + n + 1 if A346149(n) > 0.
%e A346154 a(9) = 739 because 9^3 + 9 + 1 = 739 is prime while 9^2 + 9 + 1 is not.
%p A346154 f:= proc(n) local i;
%p A346154 if n mod 3 = 1 then return 0 fi;
%p A346154 for i from 2 do if isprime(n^i+n+1) then return n^i+n+1 fi od:
%p A346154 end proc:
%p A346154 f(1):= 3:
%p A346154 map(f, [$1..100]);
%o A346154 (Python)
%o A346154 from sympy import isprime
%o A346154 def a(n):
%o A346154     if n > 1 and n%3 == 1: return 0
%o A346154     k = 2
%o A346154     while not isprime(n**k + n + 1): k += 1
%o A346154     return n**k + n + 1
%o A346154 print([a(n) for n in range(1, 52)]) # _Michael S. Branicky_, Jul 07 2021
%Y A346154 Cf. A346149.
%K A346154 nonn
%O A346154 1,1
%A A346154 _J. M. Bergot_ and _Robert Israel_, Jul 07 2021