OFFSET
1,3
LINKS
Jack Zhang, Table of n, a(n) for n = 1..1000
EXAMPLE
a(5)=5: the pairs are (1, 2), (1, 3), (1, 4), (2, 1), (1, 1).
PROG
(Python)
def sets(n):
s = 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**2)==0:
s.add((k, j))
return len(s)
[sets(i) for i in range(1, 50)]
(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^2, y, n))); \\ Michel Marcus, May 14 2018
(Python)
from sympy import divisors, integer_nthroot
def A302293(n):
s = set()
for i in range(1, n):
for j in divisors(i):
if integer_nthroot(j, 2)[1]:
for k in divisors(n-i):
s.add((j, k))
return len(s) # Chai Wah Wu, May 26 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Jack Zhang, Apr 04 2018
STATUS
approved