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.

A237627 Semiprimes of the form n^3 + n^2 + n + 1.

This page as a plain text file.
%I A237627 #41 Aug 04 2023 01:51:39
%S A237627 4,15,85,259,1111,4369,47989,65641,291919,2016379,2214031,3397651,
%T A237627 3820909,5864581,9305311,13881841,15687751,16843009,19756171,22030681,
%U A237627 28746559,62256349,64160401,74264821,79692331,101412319,117889591,172189309,185518471,191435329
%N A237627 Semiprimes of the form n^3 + n^2 + n + 1.
%C A237627 All the terms in the sequence, except a(1), are odd.
%C A237627 Since n^3 + n^2 + n + 1 = (n^2 + 1)(n + 1), it is a necessary condition for n^2 + 1 to be a prime, and n + 1 as well. - _Alonso del Arte_, Apr 22 2014
%H A237627 K. D. Bajpai, <a href="/A237627/b237627.txt">Table of n, a(n) for n = 1..2539</a>
%F A237627 Union of {4} and the members of A176070. - _R. J. Mathar_, Oct 04 2018
%e A237627 85 is in the sequence since 4^3 + 4^2 + 4 + 1 = 85 = 5 * 17, which is a semiprime.
%e A237627 259 is in the sequence since 6^3 + 6^2 + 6 + 1 = 259 = 7 * 37 which is a semiprime.
%e A237627 585 is not in the sequence, because, although it is 8^3 + 8^2 + 8 + 1, it has more than two prime factors.
%p A237627 select(x-> numtheory[bigomega](x)=2, [n^3+n^2+n+1$n=1..1500])[];
%t A237627 A237627 = {}; Do[t = n^3 + n^2 + n + 1; If[PrimeOmega[t] == 2, AppendTo[A237627, t]], {n, 1500}]; A237627 (* _K. D. Bajpai_ *)
%t A237627 (* For the b-file: *) n = 0; Do[t = k^3 + k^2 + k + 1; If[PrimeOmega[t] == 2, n++; Print[n, " ", t]], {k, 300000}] (* _K. D. Bajpai_ *)
%t A237627 Select[Table[n^3 + n^2 + n + 1, {n, 500}], PrimeOmega[#] == 2 &] (* _Alonso del Arte_, Apr 22 2014 *)
%o A237627 (Magma) IsSemiprime:=func<i | &+[d[2]: d in Factorization(i)] eq 2>; [s: n in [1..1000] | IsSemiprime(s) where s is n^3+n^2+n+1]; // _Bruno Berselli_, Apr 23 2014
%o A237627 (Sage) A237627 = list(n^3 + n^2 + n + 1 for n in (1..1000) if is_prime(n^2+1) and is_prime(n+1)); print(A237627) # _Bruno Berselli_, Apr 23 2014 - see comment by _Alonso del Arte_
%o A237627 (PARI) is(n)=isprime(n^2+1) && isprime(n+1) \\ _Charles R Greathouse IV_, Aug 25 2014
%o A237627 (Python)
%o A237627 from itertools import islice
%o A237627 from sympy import isprime, nextprime
%o A237627 def A237627_gen(): # generator of terms
%o A237627     p = 1
%o A237627     while (p:=nextprime(p)):
%o A237627         if isprime((p-1)**2+1):
%o A237627             yield p*((p-1)**2+1)
%o A237627 A237627_list = list(islice(A237627_gen(),20)) # _Chai Wah Wu_, Feb 27 2023
%Y A237627 Cf. A070689 (associated n).
%Y A237627 Cf. A053698, A001358, A005898, A046315, A046388, A240859, A240884, A241060, A241102.
%K A237627 nonn
%O A237627 1,1
%A A237627 _K. D. Bajpai_, Apr 22 2014