OFFSET
1,1
COMMENTS
One can call such pairs {n, n+2} mutually (or amicably) step 2 refactorable numbers.
All terms are even.
Proof. Let us suppose n is odd. Then so is n+2 and the number of their divisors has to be odd, which implies they are squares (see the proof in A268066). Since the separation between closest squares is 2n+1, it is always greater than 2, except for n=0, when it is 1.
Contains 48 + 160*k if 3 + 10*k and 5 + 16*k are prime. Dickson's conjecture implies that there are infinitely many of these. - Robert Israel, May 09 2016
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
4 is a term because its number of divisors (3) divides 6=4+2 and the number of divisors of 6 (4) divides 4.
MAPLE
select(n -> n mod numtheory:-tau(n+2)=0 and (n+2) mod numtheory:-tau(n) = 0,
2*[$1..10000]); # Robert Israel, May 09 2016
MATHEMATICA
lst={}; Do[ If[ Divisible[n, DivisorSigma[0, n+2]]&&Divisible[n+2, DivisorSigma[0, n]], AppendTo[lst, n]], {n, 12000}]; lst
Select[Range[12000], Divisible[#, DivisorSigma[0, # + 2]] && Divisible[# + 2, DivisorSigma[0, #]] &]
PROG
(PARI) for(n=1, 12000, (n%numdiv(n+2)==0)&&((n+2)%numdiv(n)==0)&&print1(n ", "))
(Python)
from sympy import divisors
def ok(n): return n%len(divisors(n+2)) == 0 and (n+2)%len(divisors(n)) == 0
print(list(filter(ok, range(1, 9711)))) # Michael S. Branicky, Apr 30 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Waldemar Puszkarz, Apr 27 2016
STATUS
approved