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
0, 0, 2, 3, 9, 14, 20, 25, 32, 44, 54, 63, 77, 90, 104, 113, 135, 149, 170, 187, 209, 230, 252, 273, 294, 324, 347, 375, 405, 434, 464, 489, 527, 560, 594, 618, 665, 702, 740, 777, 819, 860, 902, 943, 986, 1034, 1080, 1121, 1168, 1219, 1274, 1323, 1377, 1427, 1484, 1537 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
FORMULA
a(n) = n*(n-1)/2 - Sum_{k=1..n-1} (1 - ceiling(n/k^2) + floor(n/k^2)) * k.
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
EXAMPLE
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.
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.
MATHEMATICA
Table[Sum[k*(Ceiling[n/k^2] - Floor[n/k^2]), {k, n - 1}], {n, 60}]
PROG
(PARI) a(n) = sum(k=1, n-1, if (n % k^2, k)); \\ Michel Marcus, Jan 31 2021
(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
(Python)
from sympy import divisor_sigma, integer_nthroot
from sympy.ntheory.factor_ import core
def A338234(n):
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
CROSSREFS
Sequence in context: A057293 A109662 A116222 * A048038 A113501 A101067
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Jan 30 2021
STATUS
approved

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 April 19 18:00 EDT 2024. Contains 371797 sequences. (Running on oeis4.)