A285309 Sum of nonsquare divisors of n.
0, 2, 3, 2, 5, 11, 7, 10, 3, 17, 11, 23, 13, 23, 23, 10, 17, 29, 19, 37, 31, 35, 23, 55, 5, 41, 30, 51, 29, 71, 31, 42, 47, 53, 47, 41, 37, 59, 55, 85, 41, 95, 43, 79, 68, 71, 47, 103, 7, 67, 71, 93, 53, 110, 71, 115, 79, 89, 59, 163, 61, 95, 94, 42, 83, 143, 67, 121, 95, 143, 71, 145, 73, 113, 98
Offset: 1
Keywords
Examples
a(6) = 11 because 6 has 4 divisors {1, 2, 3, 6} among which 3 are nonsquares {2, 3, 6} therefore 2 + 3 + 6 = 11.
Links
Programs
-
Mathematica
Table[DivisorSum[n, # &, Mod[DivisorSigma[0, #], 2] == 0 &], {n, 1, 75}] nmax = 75; Rest[CoefficientList[Series[Sum[(k + Floor[1/2 + Sqrt[k]]) x^(k + Floor[1/2 + Sqrt[k]])/(1 - x^(k + Floor[1/2 + Sqrt[k]])), {k, 1, nmax}], {x, 0, nmax}], x]] Array[DivisorSum[#, # &, ! IntegerQ@ Sqrt@ # &] &, 75] (* Michael De Vlieger, Nov 23 2017 *)
-
PARI
a(n) = sumdiv(n, d, if (!issquare(d), d)); \\ Michel Marcus, Apr 17 2017
-
Python
import gmpy from sympy import divisors def a(n): return sum([d for d in divisors(n) if gmpy.is_square(d)==0]) # Indranil Ghosh, Apr 18 2017