The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A326119 a(n) is the absolute value of the alternating sum of the first n increasing perfect powers (A001597): 1, 1-4, 1-4+8, 1-4+8-9, ... 0
 1, 3, 5, 4, 12, 13, 14, 18, 18, 31, 33, 48, 52, 69, 56, 72, 72, 97, 99, 117, 108, 135, 121, 168, 156, 187, 174, 226, 215, 269, 243, 286, 290, 335, 341, 388, 396, 445, 455, 506, 494, 530, 559, 597, 628, 668, 663, 706, 738, 783, 817, 864, 864, 900, 949, 987, 1038 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 LINKS FORMULA a(n) = abs(Sum_{k=1..n} (-1)^k*A001597(k)). - Andrew Howroyd, Sep 10 2019 EXAMPLE For n=8: a(8) = |1 - 4 + 8 - 9 + 16 - 25 + 27 - 32|. MATHEMATICA t = Select[Range@2400, # == 1 || GCD @@ Last /@ FactorInteger@# > 1 &]; Abs@ Accumulate[t (-1)^Range@ Length[t]] (* Giovanni Resta, Sep 11 2019 *) PROG (PARI) seq(n)={my(v=vector(n), i=0, k=0, s=0); while(i<#v, k++; if(ispower(k)||k==1, s=k-s; i++; v[i]=abs(s))); v} \\ Andrew Howroyd, Sep 10 2019 CROSSREFS Cf. A001597, A076408. Sequence in context: A335500 A127397 A284048 * A201271 A324779 A167808 Adjacent sequences:  A326116 A326117 A326118 * A326120 A326121 A326122 KEYWORD nonn AUTHOR Richard Locke Peterson, Sep 10 2019 STATUS approved

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 October 26 08:06 EDT 2020. Contains 338027 sequences. (Running on oeis4.)