Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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!)
Search: a032514 -id:a032514
Displaying 1-4 of 4 results found. page 1
     Sort: relevance | references | number | modified | created      Format: long | short | data
A268173 a(n) = Sum_{k=0..n} (-1)^k*floor(sqrt(k)). +10
4
0, -1, 0, -1, 1, -1, 1, -1, 1, -2, 1, -2, 1, -2, 1, -2, 2, -2, 2, -2, 2, -2, 2, -2, 2, -3, 2, -3, 2, -3, 2, -3, 2, -3, 2, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -3, 3, -4, 3, -4, 3, -4, 3, -4, 3, -4, 3, -4, 3, -4, 3, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,10
LINKS
FORMULA
a(n) = floor(sqrt(n))*(-1)^n/2 - ((-1)^(floor(sqrt(n))+1)+1)/4.
a(n) = (-1)^n * Sum_{i=1..ceiling(n/2)} c(n+2-2*i), where c is the square characteristic (A010052). - Wesley Ivan Hurt, Nov 26 2020
From Ridouane Oudra, Jan 21 2024: (Start)
a(n) = (-1)^n*floor((sqrt(n) + (n mod 2))/2);
a(2*n) = floor(sqrt(n/2));
a(2*n+1) = -floor(sqrt((n+1)/2) + 1/2). (End)
EXAMPLE
a(5) = -1 = floor(sqrt(0)) - floor(sqrt(1)) + floor(sqrt(2)) - floor(sqrt(3)) + floor(sqrt(4)) - floor(sqrt(5)).
MAPLE
seq(add((-1)^k*floor(sqrt(k)), k=0..n), n=0..80); # Ridouane Oudra, Jan 21 2024
MATHEMATICA
Table[Sum[(-1)^k Floor[Sqrt@ k], {k, 0, n}], {n, 0, 50}] (* Michael De Vlieger, Mar 15 2016 *)
PROG
(PARI) a(n) = sum(k=0, n, (-1)^k*sqrtint(k)); \\ Michel Marcus, Jan 28 2016
(PARI) a(n) = sqrtint(n)*(-1)^n/2-((-1)^(sqrtint(n)+1)+1)/4; \\ John M. Campbell, Mar 15 2016
CROSSREFS
KEYWORD
sign,easy
AUTHOR
John M. Campbell, Jan 28 2016
EXTENSIONS
Terms a(55) and beyond from Andrew Howroyd, Mar 02 2020
STATUS
approved
A270370 a(n) = Sum_{k=0..n} (-1)^k*floor(k^(1/3)). +10
2
0, -1, 0, -1, 0, -1, 0, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 2, -2, 2, -2, 2, -2 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,28
LINKS
FORMULA
a(n) = floor(n^(1/3))*(-1)^n/2 - ((-1)^(floor(n^(1/3))+1)+1)/4.
EXAMPLE
a(5) = [0^(1/3)]-[1^(1/3)]+[2^(1/3)]-[3^(1/3)]+[4^(1/3)]-[5^(1/3)] = 0-1+1-1+1-1 = -1, letting [] denote the floor function.
MATHEMATICA
Print[Table[Sum[(-1)^i*Floor[i^(1/3)], {i, 0, n}], {n, 0, 100}]]
PROG
(PARI) a(n)=sum(i=0, n, (-1)^i*sqrtnint(i, 3))
(PARI) a(n)=sqrtnint(n, 3)*(-1)^n/2-((-1)^(sqrtnint(n, 3)+1)+1)/4
CROSSREFS
KEYWORD
sign,easy
AUTHOR
John M. Campbell, Mar 15 2016
STATUS
approved
A262352 a(n) = Sum_{k=0..n} (-1)^k*floor(k^(1/4)). +10
1
0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1, -2, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,82
LINKS
FORMULA
a(n) = floor(n^(1/4))*(-1)^n/2-((-1)^(floor(n^(1/4))+1)+1)/4.
EXAMPLE
Letting [] denote the floor function, a(7) = [0^(1/4)] - [1^(1/4)] + [2^(1/4)] - [3^(1/4)] + [4^(1/4)] - [5^(1/4)] + [6^(1/4)] - [7^(1/4)] = 0 - 1 + 1 - 1 + 1 - 1 + 1 - 1 = -1.
MATHEMATICA
Print[Table[Sum[(-1)^k*Floor[k^(1/4)], {k, 0, n}], {n, 0, 100}]] ;
PROG
(PARI) a(n)=floor(n^(1/4))*(-1)^n/2-((-1)^(floor(n^(1/4))+1)+1)/4
(PARI) a(n)=sum(k=0, n, (-1)^k*floor(k^(1/4)))
(PARI) A262352(n) = sum(k=0, n, ((-1)^k)*sqrtnint(k, 4)); \\ Antti Karttunen, Nov 06 2018
CROSSREFS
KEYWORD
sign,easy
AUTHOR
John M. Campbell, Mar 24 2016
EXTENSIONS
More terms from Antti Karttunen, Nov 06 2018
STATUS
approved
A270825 a(n) = Sum_{i=0..n} (-1)^floor(i/2)*floor(sqrt(i)). +10
0
0, 1, 0, -1, 1, 3, 1, -1, 1, 4, 1, -2, 1, 4, 1, -2, 2, 6, 2, -2, 2, 6, 2, -2, 2, 7, 2, -3, 2, 7, 2, -3, 2, 7, 2, -3, 3, 9, 3, -3, 3, 9, 3, -3, 3, 9, 3, -3, 3, 10, 3, -4, 3, 10, 3, -4, 3, 10, 3, -4, 3, 10, 3, -4, 4, 12, 4, -4, 4, 12, 4, -4, 4, 12, 4, -4, 4 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,6
LINKS
FORMULA
a(4m)=floor(sqrt(m)), a(4m+1)=floor(3/2*floor(sqrt(4m+1))), a(4m+2)=floor(sqrt(m)), a(4m+3)=-floor((1+sqrt(4m+3))/2).
EXAMPLE
Letting [] denote the floor function, a(7) = [sqrt(0)]+[sqrt(1)]-[sqrt(2)]-[sqrt(3)]+[sqrt(4)]+[sqrt(5)]-[sqrt(6)]-[sqrt(7)] = 0+1-1-1+2+2-2-2 = -1.
MATHEMATICA
Print[Table[Sum[(-1)^(Floor[i/2])*Floor[Sqrt[i]], {i, 0, n}], {n, 0, 100}]]
PROG
(PARI) a(n)=sum(i=0, n, (-1)^(floor(i/2))*floor(sqrt(i)))
CROSSREFS
KEYWORD
sign,easy
AUTHOR
John M. Campbell, Mar 23 2016
STATUS
approved
page 1

Search completed in 0.021 seconds

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 27 22:40 EDT 2024. Contains 375471 sequences. (Running on oeis4.)