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.

A128248 a(n) = Sum_{k=1..phi(n)} t(k,n)*(-1)^k, where t(k,n) is the k-th positive integer that is coprime to n and phi(n) = A000010(n).

Original entry on oeis.org

-1, -1, 1, 2, 2, 4, 3, 4, 3, 4, 5, 8, 6, 8, 8, 8, 8, 12, 9, 8, 8, 12, 11, 16, 10, 12, 9, 16, 14, 16, 15, 16, 16, 16, 16, 24, 18, 20, 16, 16, 20, 16, 21, 24, 24, 24, 23, 32, 21, 20, 24, 24, 26, 36, 24, 32, 24, 28, 29, 32, 30, 32, 24, 32, 32, 32, 33, 32, 32, 32, 35, 48, 36, 36, 40, 40, 40, 32, 39, 32, 27, 40, 41, 32, 40, 44, 40, 48, 44, 48, 48
Offset: 1

Views

Author

Leroy Quet, May 03 2007

Keywords

Comments

a(1) and a(2) are the only negative terms of the sequence.

Examples

			The positive integers which are <= 10 and are coprime to 10 are 1,3,7,9. So a(10) = -1 + 3 - 7 + 9 = 4.
		

Crossrefs

Programs

  • Maple
    with(numtheory): t:=proc(k,n) local A,i: A:={}: for i from 1 while nops(A)<=k do if igcd(i,n)=1 then A:=A union {i} else A:=A: fi od: A[k] end: a:=n->add((-1)^k*t(k,n),k=1..phi(n)): seq(a(n),n=1..100); # Emeric Deutsch, May 06 2007
  • Mathematica
    Table[Total[Times@@@Partition[Riffle[Select[Range[n],CoprimeQ[#,n]&],{-1,1},{2,-1,2}],2]],{n,100}] (* Harvey P. Dale, May 05 2013 *)

Extensions

More terms from Emeric Deutsch, May 06 2007