OFFSET
1,1
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
603 is a term since 603 = 3^2 * 67, 603 + 1 = 604 = 2^2 * 151 and 603 + 2 = 605 = 5 * 11^2 all have one even and one odd exponent in their prime factorization.
MATHEMATICA
q[n_] := n == 1 || Count[(e = FactorInteger[n][[;; , 2]]), _?OddQ] == Count[e, _?EvenQ]; v = q /@ Range[3]; seq = {}; Do[v = Append[Drop[v, 1], q[k]]; If[And @@ v, AppendTo[seq, k - 2]], {k, 4, 130000}]; seq
PROG
(Python)
from sympy import factorint
def aupto(limit):
alst, condvec = [], [False, False, False]
for kp2 in range(4, limit+3):
evenodd = [0, 0]
for e in factorint(kp2).values():
evenodd[e%2] += 1
condvec = condvec[1:] + [evenodd[0] == evenodd[1]]
if all(condvec):
alst.append(kp2-2)
return alst
print(aupto(126927)) # Michael S. Branicky, Sep 27 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Amiram Eldar, Sep 27 2021
STATUS
approved