OFFSET
1,3
FORMULA
EXAMPLE
a(5)=9; all pairs are (1, 2), (3, 2), (1, 3), (3, 1), (2, 1), (1, 4), (2, 3), (4, 1), (1, 1).
MATHEMATICA
f[n_] := {#, n/#} & /@ Divisors@ n; Array[Length@ Union@ Apply[Join, {#, Reverse /@ #}] &@ Apply[Join, Map[Apply[Join, Outer[{#1, #2} &, #1, #2, 1]][[All, All, -1]] & @@ Map[f, #] &, IntegerPartitions[#, {2}]]] &, 68, 2] (* Michael De Vlieger, May 14 2018 *)
PROG
(Python)
def sets(n):
res=set()
for i in range(1, n):
for j in range(1, i+1):
if i%j==0:
for k in range(1, n-i+1):
if (n-i)%(k)==0:
res.add((j, k))
return res
[len(sets(i)) for i in range(1, 100)]
(PARI) isok(x, y, n) = {for (p=1, n, for (q=1, n, if (p*x+q*y ==n, return (1)); ); ); return (0); }
a(n) = sum(x=1, n, sum(y=1, n, isok(x, y, n))); \\ Michel Marcus, May 14 2018
(Python)
from __future__ import division
from sympy import divisors
def A302292(n):
s = set()
for i in range(1, (n+3)//2):
for j in divisors(i):
for k in divisors(n-i):
if j != k:
s.add((min(j, k), max(j, k)))
return divisor_count(n)+2*len(s)-1 # Chai Wah Wu, May 24 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Jack Zhang, Apr 04 2018
STATUS
approved