A337110 Number of length three 1..n vectors that contain their geometric mean.
1, 2, 3, 10, 11, 12, 13, 20, 33, 34, 35, 42, 43, 44, 45, 64, 65, 78, 79, 86, 87, 88, 89, 96, 121, 122, 135, 142, 143, 144, 145, 164, 165, 166, 167, 198, 199, 200, 201, 208, 209, 210, 211, 218, 231, 232, 233, 252, 289, 314, 315, 322, 323, 336, 337, 344, 345, 346
Offset: 1
Examples
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).
Links
- Hywel Normington, Python code, 2020.
- Hywel Normington, Julia code, 2023.
Programs
-
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
Formula
a(n) = a(n-1) + 1 + 6*A057918(n).
Comments