OFFSET
1,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = n + Sum_{1<=i<j<=n, (i+j)|2*i*j} 2. - Chai Wah Wu, Aug 28 2023
MAPLE
a:= proc(n) option remember; `if`(n=0, 0, a(n-1)-1+
2*add(`if`(irem(2*i*n, i+n)=0, 1, 0), i=1..n))
end:
seq(a(n), n=1..80); # Alois P. Heinz, Aug 28 2023
MATHEMATICA
a[n_] := a[n] = If[n == 0, 0, a[n-1] - 1 +
2*Sum[If[Mod[2*i*n, i+n] == 0, 1, 0], {i, 1, n}]];
Table[a[n], {n, 1, 80}] (* Jean-François Alcover, Oct 13 2024, after Alois P. Heinz *)
PROG
(Python)
def A362931(n): return n+(sum(1 for x in range(1, n+1) for y in range(1, x) if not (x*y<<1)%(x+y))<<1) # Chai Wah Wu, Aug 28 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Aug 28 2023
STATUS
approved