OFFSET
1,2
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
KEYWORD
nonn
AUTHOR
Richard Locke Peterson, Sep 10 2019
STATUS
approved