This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A108174 Partial sums of the positive integers n according to the rule: if n is square then subtract n else add n. 1

%I

%S 0,-1,1,4,0,5,11,18,26,17,27,38,50,63,77,92,76,93,111,130,150,171,193,

%T 216,240,215,241,268,296,325,355,386,418,451,485,520,484,521,559,598,

%U 638,679,721,764,808,853,899,946,994,945,995,1046,1098,1151,1205,1260,1316,1373,1431,1490,1550,1611,1673,1736,1672

%N Partial sums of the positive integers n according to the rule: if n is square then subtract n else add n.

%H Harvey P. Dale, <a href="/A108174/b108174.txt">Table of n, a(n) for n = 0..1000</a>

%t Accumulate[Table[If[IntegerQ[Sqrt[n]],-n,n],{n,0,70}]] (* _Harvey P. Dale_, Jan 17 2017 *)

%o (PARI) g(n) = s=0;for(x=0,n,if(issquare(x),s-=x,s+=x);print1(s","))

%K easy,sign

%O 0,4

%A _Cino Hilliard_, Jun 13 2005

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified May 24 11:23 EDT 2019. Contains 323529 sequences. (Running on oeis4.)