OFFSET
1,2
COMMENTS
If p > 2 is prime, a(p) = 4. There are 4 rectangles that can be made with one even and one odd side length that are divisors of 2p: 1 X 2, 1 X 2p, 2 X p, and p X 2p. - Wesley Ivan Hurt, May 21 2021
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..20000
FORMULA
a(n) = Sum_{d1|(2*n), d2|(2*n), d1<d2} (1 - [d1 mod 2 = d2 mod 2]), where [ ] is the Iverson bracket.
a(n) = tau(n)*(tau(2*n) - tau(n)), with tau(n) = A000005(n). - Ridouane Oudra, Feb 19 2023
EXAMPLE
a(6) = 8; The divisors of 2*6 = 12 are {1,2,3,4,6,12}. There are 8 distinct rectangles with one odd and one even side length using these divisors. They are 1 X 2, 1 X 4, 1 X 6, 1 X 12, 2 X 3, 3 X 4, 3 X 6, and 3 X 12.
MAPLE
with(numtheory): seq(tau(n)*(tau(2*n)-tau(n)), n=1..100); # Ridouane Oudra, Feb 19 2023
MATHEMATICA
Table[Sum[Sum[KroneckerDelta[Mod[i + 1, 2], Mod[k, 2]]*(1 - Ceiling[2n/k] + Floor[2n/k]) (1 - Ceiling[2n/i] + Floor[2n/i]), {i, k-1}], {k, 2n}], {n, 100}]
PROG
(PARI) A335841(n) = { my(ds=divisors(2*n)); sum(i=2, #ds, sum(j=1, i-1, (ds[i]+ds[j])%2)); }; \\ Antti Karttunen, Dec 09 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Sep 13 2020
STATUS
approved