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!)
A338234 Sum of the numbers less than n whose square does not divide n. 7

%I #29 Jun 30 2021 09:06:44

%S 0,0,2,3,9,14,20,25,32,44,54,63,77,90,104,113,135,149,170,187,209,230,

%T 252,273,294,324,347,375,405,434,464,489,527,560,594,618,665,702,740,

%U 777,819,860,902,943,986,1034,1080,1121,1168,1219,1274,1323,1377,1427,1484,1537

%N Sum of the numbers less than n whose square does not divide n.

%H Felix Fröhlich, <a href="/A338234/b338234.txt">Table of n, a(n) for n = 1..10000</a>

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

%F For n > 1, a(n) = n*(n-1)/2 - sigma(sqrt(n/A007913(n)) = A000217(n-1)-A000203(sqrt(n/A007913(n)). - _Chai Wah Wu_, Jan 31 2021

%e a(7) = 20; 1^2|7, but the squares of 2,3,4,5 and 6 do not. So a(7) = 2 + 3 + 4 + 5 + 6 = 20.

%e a(8) = 25; 1^2|8 and 2^2|8, but the squares of 3,4,5,6 and 7 do not. So a(8) = 3 + 4 + 5 + 6 + 7 = 25.

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

%o (PARI) a(n) = sum(k=1, n-1, if (n % k^2, k)); \\ _Michel Marcus_, Jan 31 2021

%o (PARI) a(n) = my(res = binomial(n, 2), f = factor(n)); f[,2]>>=1; res-sigma(factorback(f))+(n==1) \\ _David A. Corneth_, Jan 31 2021

%o (Python)

%o from sympy import divisor_sigma, integer_nthroot

%o from sympy.ntheory.factor_ import core

%o def A338234(n):

%o return 0 if n <= 1 else n*(n-1)//2 - divisor_sigma(integer_nthroot(n//core(n,2),2)[0]) # _Chai Wah Wu_, Jan 31 2021

%Y Cf. A000217, A000203, A007913, A338228, A338231, A338233, A338236, A338430, A338434.

%K nonn,easy

%O 1,3

%A _Wesley Ivan Hurt_, Jan 30 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 August 5 04:06 EDT 2024. Contains 374935 sequences. (Running on oeis4.)