OFFSET
1,1
EXAMPLE
a(1) = 1^2 + 1.
a(2) = 2^2 + 2.
a(3) = 3^2 + 3.
a(4) = 4^2 + 5.
MATHEMATICA
Module[{nn=40, sqs, sfree}, sqs=Range[nn]^2; sfree=Take[Select[Range[3nn], SquareFreeQ], nn]; Total/@Thread[{sqs, sfree}]] (* Harvey P. Dale, May 06 2012 *)
PROG
(Python)
from math import isqrt
from sympy import mobius
def A161203(n):
def f(x): return n+x-sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1))
m, k = n, f(n)
while m != k:
m, k = k, f(k)
return m+n**2 # Chai Wah Wu, Aug 12 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Jonathan Vos Post, Jan 20 2011
EXTENSIONS
Corrected (75 inserted) by Harvey P. Dale, May 06 2012
STATUS
approved