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.

A163296 Absolute value of the Sum_{x=0..A141468(n)} x*(-1)^x.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 5, 6, 7, 8, 8, 9, 10, 11, 11, 12, 13, 13, 14, 14, 15, 16, 17, 17, 18, 18, 19, 20, 20, 21, 22, 23, 23, 24, 25, 25, 26, 26, 27, 28, 28, 29, 29, 30, 31, 32, 32, 33, 33, 34, 35, 35, 36, 37, 38, 38, 39, 39, 40, 41, 41, 42, 43, 43, 44, 44, 45, 46, 46, 47, 47, 48, 48, 49, 50, 50, 51, 52, 53, 53
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jul 24 2009

Keywords

Examples

			a(1)=abs(0*(-1)^0)=1, a(2)=abs(0*(-1)^0+1*(-1)^1)=1-1=0, a(3)=abs(1-1+2-3+4)=3, a(4)=abs(1-1+2-3+4-5+6)=4, a(5)=abs(1-1+2-3+4-5+6-7+8)=5, a(6)=abs(1-1+2-3+4-5+6-7+8-9)=abs(-4)=4.
		

Crossrefs

Cf. A141468.

Programs

  • Maple
    A130472 := proc(n) (-1)^n*floor((n+1)/2) ; end: A141468 := proc(n) option remember; local a; if n = 1 then 0 ; else for a from procname(n-1)+1 do if not isprime(a) then RETURN(a) ; fi; od: fi; end: A163296 := proc(n) abs(A130472( A141468(n))) ; end: seq(A163296(n),n=1..100) ; # R. J. Mathar, Jul 26 2009
  • Mathematica
    nonPrime[n_Integer] := FixedPoint[n + PrimePi@# &, n + PrimePi@n]; Table[Abs[Sum[k*(-1)^k, {k, 0, nonPrime[n]}]], {n,0,50}] (* G. C. Greubel, Dec 18 2016 *)

Formula

a(n) = |A130472(A141468(n))|. - R. J. Mathar, Jul 26 2009

Extensions

Corrected by R. J. Mathar, Jul 26 2009