cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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, ...

Original entry on oeis.org

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
Offset: 1

Views

Author

Richard Locke Peterson, Sep 10 2019

Keywords

Examples

			For n=8: a(8) = |1 - 4 + 8 - 9 + 16 - 25 + 27 - 32|.
		

Crossrefs

Programs

  • Mathematica
    t = Select[Range@2400, # == 1 || GCD @@ Last /@ FactorInteger@# > 1 &]; Abs@ Accumulate[t (-1)^Range@ Length[t]] (* Giovanni Resta, Sep 11 2019 *)
  • 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

Formula

a(n) = abs(Sum_{k=1..n} (-1)^k*A001597(k)). - Andrew Howroyd, Sep 10 2019