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!)
A190613 a(n) = Sum_{k=1..n} (-1)^(n-floor(n/k)) * floor(n/k). 2

%I #18 Feb 19 2023 17:22:08

%S 0,1,1,5,4,6,2,12,12,11,1,21,17,9,7,37,18,16,10,28,30,30,-6,52,48,11,

%T 17,59,19,39,9,53,65,27,9,83,44,30,10,98,54,28,36,50,68,82,-34,128,98,

%U 13,49,91,47,59,21,119,85,71,-11,129,107,15,49,153,92,72,24,110,68,120,-24,166,166,-20

%N a(n) = Sum_{k=1..n} (-1)^(n-floor(n/k)) * floor(n/k).

%H John Tyler Rascoe, <a href="/A190613/b190613.txt">Table of n, a(n) for n = 0..10000</a>

%t Table[Sum[(-1)^(n-Floor[n/k] ) Floor[n/k],{k,n}],{n,0,80}] (* _Harvey P. Dale_, May 01 2018 *)

%o (PARI) a(n)=sum(k=1,n,(-1)^(n-n\k)*(n\k))

%o (Python)

%o from math import floor

%o def A190613(n):

%o z = 0

%o for k in range(1,n+1):

%o x = floor(n/k)

%o y = ((-1)**(n-x))*x

%o z += y

%o return(z) # _John Tyler Rascoe_, Feb 19 2023

%Y Cf. A059851, A006218.

%K sign,look

%O 0,4

%A _Franklin T. Adams-Watters_, May 14 2011

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 25 06:49 EDT 2024. Contains 371964 sequences. (Running on oeis4.)