OFFSET
1,1
LINKS
David A. Corneth, Table of n, a(n) for n = 1..318
Cody S. Hansen and Pace P. Nielsen, Prime factors of phi3(x) of the same form, arXiv:2204.08971 [math.NT], 2022.
EXAMPLE
21 = 4^2+4+1 and its factors are 3 and 7, terms of A002383. So 21 is a term.
MAPLE
q:= n-> not isprime(n) and andmap(p-> issqr(4*p-3), numtheory[factorset](n)):
select(q, [k*(k+1)+1$k=4..6000])[]; # Alois P. Heinz, Apr 20 2022
MATHEMATICA
Select[Table[n^2 + n + 1, {n, 1, 6000}], CompositeQ[#] && AllTrue[FactorInteger[#][[;; , 1]], IntegerQ@Sqrt[4*#1 - 3] &] &] (* Amiram Eldar, Apr 20 2022 *)
PROG
(PARI) lista(nn) = {for (n=1, nn, my(x=n^2+n+1); if (! isprime(x), my(fa=factor(x), ok=1); for (k=1, #fa~, my(fk=fa[k, 1]); if (! issquare(4*fk-3), ok = 0); ); if (ok, print1(x, ", ")); ); ); }
(Python)
from sympy import isprime, factorint
from itertools import count, takewhile
def agento(N): # generator of terms up to limit N
form = set(takewhile(lambda x: x<=N, (k**2 + k + 1 for k in count(1))))
for t in sorted(form):
if not isprime(t) and all(p in form for p in factorint(t)):
yield t
print(list(agento(10**8))) # Michael S. Branicky, Apr 20 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Marcus, Apr 20 2022
STATUS
approved