OFFSET
1,1
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
44 is a term since 44 = 2^2 * 11 and 44 + 1 = 45 = 3^2 * 5 both 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]; Select[Range[2500], q[#] && q[# + 1] &]
PROG
(Python)
from sympy import factorint
def aupto(limit):
alst, cond = [], False
for nxtk in range(3, limit+2):
evenodd = [0, 0]
for e in factorint(nxtk).values():
evenodd[e%2] += 1
nxtcond = (evenodd[0] == evenodd[1])
if cond and nxtcond:
alst.append(nxtk-1)
cond = nxtcond
return alst
print(aupto(2523)) # Michael S. Branicky, Sep 27 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Amiram Eldar, Sep 27 2021
STATUS
approved