A065056 Partial sums of Recamán's sequence A005132.
0, 1, 4, 10, 12, 19, 32, 52, 64, 85, 96, 118, 128, 151, 160, 184, 192, 217, 260, 322, 364, 427, 468, 486, 528, 545, 588, 604, 648, 663, 708, 722, 768, 847, 960, 1038, 1152, 1229, 1268, 1346, 1384, 1463, 1500, 1580, 1616, 1697, 1732, 1814, 1848
Offset: 0
Keywords
Links
Crossrefs
Cf. A005132.
Programs
-
Mathematica
rr = {0}; r[0] = 0; r[n_] := r[n] = Module[{r1, rn}, r1 = r[n-1]; rn = If[r1-n >= 0 && FreeQ[rr, r1-n], r1-n, r1+n]; AppendTo[rr, rn]; rn]; Table[r[n], {n, 0, 100}] // Accumulate (* Jean-François Alcover, Aug 31 2022 *)
Comments