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!)
A344624 a(n) = Sum_{k=1..n} k^c(k), where c(n) is the characteristic function of squares. 1
1, 2, 3, 7, 8, 9, 10, 11, 20, 21, 22, 23, 24, 25, 26, 42, 43, 44, 45, 46, 47, 48, 49, 50, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 260 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
For 1 <= k <= n, take a running total: add k if k is a perfect square, otherwise add 1. For example, a(12) = 1+1+1+4+1+1+1+1+9+1+1+1 = 23.
LINKS
FORMULA
a(n) = n+m*(m-1)*(2*m+5)/6 where m = floor(sqrt(n)). - Chai Wah Wu, May 24 2021
MATHEMATICA
Table[Sum[i^(Floor[Sqrt[i]] - Floor[Sqrt[i - 1]]), {i, n}], {n, 80}]
PROG
(Python 3.8+)
from math import isqrt
def A344624(n):
m = isqrt(n)
return n + m*(m-1)*(2*m+5)//6 # Chai Wah Wu, May 24 2021
CROSSREFS
Cf. A010052.
Sequence in context: A326979 A326874 A118374 * A154432 A251391 A047361
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, May 24 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 August 19 18:08 EDT 2024. Contains 375310 sequences. (Running on oeis4.)