This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A367327 #17 Nov 15 2023 01:52:24 %S A367327 0,0,0,1,1,14,5,55,39,104,115,285,104,506,457,575,611,1240,790,1785, %T A367327 1204,1950,2349,3311,1746,3924,4155,4625,4312,6930,4375,8555,6939, %U A367327 9032,10127,10845,7887,14910,14549,15603,12730,20540,15273,23821,20648,21874,26905 %N A367327 a(n) = Sum_{(n - k) does not divide n, 0 <= k < n} k^2. %H A367327 Michael De Vlieger, <a href="/A367327/b367327.txt">Table of n, a(n) for n = 0..10000</a> %F A367327 A367326(n+1) + a(n+1) = A000330(n). %p A367327 divides := (k, n) -> k = n or (k > 0 and irem(n, k) = 0): %p A367327 A367327 := n -> local k; add(`if`(divides(n - k, n), 0, k^2), k = 0..n - 1): %p A367327 seq(A367327(n), n = 0..61); %t A367327 a[n_] := Sum[If[Divisible[n, n - k], 0, k^2], {k, 0, n - 1}] %t A367327 Table[a[n], {n, 0, 46}] %o A367327 (SageMath) %o A367327 def A367327(n): return sum(k^2 for k in (0..n-1) if not (n-k).divides(n)) %o A367327 print([A367327(n) for n in range(47)]) %o A367327 (Python) %o A367327 from math import prod %o A367327 from sympy import factorint %o A367327 def A367327(n): %o A367327 f = factorint(n).items() %o A367327 return n*(n-1)*((n<<1)-1)//6-n*(n*prod(e+1 for p,e in f)-(prod((p**(e+1)-1)//(p-1) for p,e in f)<<1))-prod((p**(e+1<<1)-1)//(p**2-1) for p,e in f) if n else 0 # _Chai Wah Wu_, Nov 14 2023 %o A367327 (PARI) a(n) = sum(k=0, n-1, if (n % (n-k), k^2)); \\ _Michel Marcus_, Nov 15 2023 %Y A367327 Cf. A367327, A000330, A024816. %K A367327 nonn %O A367327 0,6 %A A367327 _Peter Luschny_, Nov 14 2023