OFFSET
1,2
COMMENTS
From David A. Corneth, Aug 26 2020: (Start)
If x^2 == 0 (mod n) has only 1 solution then a(n) = a(n-1) + 1. Proof:
Let (a, b, n) be such a tuple. Let without loss of generality b be the geometric mean of the tuple. Then a*b*n = b^3 and as b is not 0 we have b^2 = a*n. So then b^2 == 0 (mod n). If b^2 == 0 (mod n) has only 1 solution then b = n. This gives the tuple (n, n, n) which has 1 permutation. So giving a(n) = a(n-1) + 1. (End)
LINKS
Hywel Normington, Python code, 2020.
Hywel Normington, Julia code, 2023.
FORMULA
a(n) = a(n-1) + 1 + 6*A057918(n).
EXAMPLE
For n = 2, the a(2) = 2 solutions are: (1,1,1) and (2,2,2).
For n = 4, the a(4) = 10 solutions are: (1,1,1),(2,2,2),(3,3,3),(4,4,4) and the 6 permutations of (1,2,4).
PROG
(PARI) first(n) = {my(s = 0, res = vector(n)); for(i = 1, n, s+=b(i); res[i] = s ); res }
b(n) = { my(s = factorback(factor(n)[, 1]), res = 1); for(i = 1, n \ s - 1, c = (s*i)^2/n; if(denominator(c) == 1 && c <= n, res+=6; ) ); res } \\ David A. Corneth, Aug 26 2020
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Hywel Normington, Aug 16 2020
STATUS
approved
