OFFSET
0,5
LINKS
Peter Luschny, Table of n, a(n) for n = 0..10000
FORMULA
a(n) = n^2 - 2*(n - 1)*tau(n) - 1 for n >= 1, where tau = A000005.
MATHEMATICA
A363421[n_]:=If[n==0, 1, n^2-2(n-1)DivisorSigma[0, n]-1]; Array[A363421, 100, 0] (* Paolo Xausa, Aug 06 2023 *)
PROG
(SageMath)
print([sum(n^(not k.divides(n)) - n^k.divides(n) for k in srange(n+1)) for n in srange(53)])
(Python)
from sympy import divisor_count
def A363421(n): return n**2-2*(n-1)*divisor_count(n)-1 if n else 1 # Chai Wah Wu, Jun 28 2023
CROSSREFS
KEYWORD
sign
AUTHOR
Peter Luschny, Jun 27 2023
STATUS
approved