OFFSET
0,7
COMMENTS
If p is prime then a(p) = a(p-1). - Robert G. Wilson v, Nov 20 2016
LINKS
Indranil Ghosh, Charles R Greathouse IV and Chai Wah Wu, Table of n, a(n) for n = 0..10000 (first 101 terms from Ghosh, next 1900 terms from Charles R Greathouse IV)
Charles R Greathouse IV, C program for computing this sequence
MATHEMATICA
f[n_] := f[n] = Block[{a = 1, b, c, s = 0}, While[b = a + 1; a < n + 1, While[c = b + 1; b < n + 1, While[c < n + 1, If[a != b && a != c && a != n && b != c && b != n && c != n && a*n == b*c, s++]; c++]; b++]; a++]; 8 s + f[n - 1]]; f[0] = 0; Array[f, 51] (* or *)
g[n_] := g[n] = Block[{c = 0, k = 1}, While[k < n, c += Count[ Times @@@ Select[ Tuples[ Rest@ Most@ Divisors[k*n], 2], #[[1]] < #[[2]] < n &], k*n]; k++]; c]; 8*Accumulate[ Array[g, 51]] (* much faster but both are recursive *) (* Robert G. Wilson v, Nov 20 2016 *)
PROG
(Python)
def p(n):
s=0
for a in range(n+1):
for b in range(n+1):
for c in range(n+1):
for d in range(n+1):
if (a!=b and a!=d and b!=d and c!=a and c!=b and c!=d):
if a*d==b*c:
s+=1
return s
for i in range(101):
print(str(i)+" "+str(p(i)))
(PARI) try(a, b, c, n)=my(d=b*c/a); denominator(d)==1 && d<=n && d!=a && d!=b && d!=c
a(n)=2*sum(a=3, n, sum(b=2, a-1, sum(c=1, b-1, try(a, b, c, n) + try(c, a, b, n) + try(b, a, c, n)))) \\ Charles R Greathouse IV, Nov 20 2016
(C) See Greathouse link.
CROSSREFS
KEYWORD
nonn
AUTHOR
Indranil Ghosh, Nov 18 2016
STATUS
approved