login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A345320 Sum of the divisors of n whose square does not divide n. 2

%I #18 Jun 14 2021 16:12:42

%S 0,2,3,4,5,11,7,12,9,17,11,25,13,23,23,24,17,35,19,39,31,35,23,57,25,

%T 41,36,53,29,71,31,56,47,53,47,79,37,59,55,87,41,95,43,81,74,71,47,

%U 117,49,87,71,95,53,116,71,117,79,89,59,165,61,95,100,112,83,143,67,123,95,143,71,183,73,113,118,137,95,167,79,179,108,125,83

%N Sum of the divisors of n whose square does not divide n.

%F a(n) = Sum_{k=1..n} k * (ceiling(n/k^2) - floor(n/k^2)) * (1 - ceiling(n/k) + floor(n/k)).

%F a(n) = A000203(n) - A069290(n). - _Rémy Sigrist_, Jun 14 2021

%e a(16) = 24; The divisors of 16 whose square does not divide 16 are 8 and 16. The sum of the divisors is then 8 + 16 = 24.

%t Table[Sum[k (Ceiling[n/k^2] - Floor[n/k^2]) (1 - Ceiling[n/k] + Floor[n/k]), {k, n}], {n, 80}]

%o (PARI) a(n) = sumdiv(n, d, if (n % d^2, d)); \\ _Michel Marcus_, Jun 13 2021

%o (Python 3.8+)

%o from math import prod

%o from sympy import factorint

%o def A345320(n):

%o f = factorint(n).items()

%o return (prod(p**(q+1)-1 for p, q in f) - prod(p**(q//2+1)-1 for p, q in f))//prod(p-1 for p, q in f) # _Chai Wah Wu_, Jun 14 2021

%Y Cf. A000203, A056595, A069290.

%K nonn

%O 1,2

%A _Wesley Ivan Hurt_, Jun 13 2021

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 12 15:04 EDT 2024. Contains 372482 sequences. (Running on oeis4.)