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.

A099001 a(n) = (Sum 1/k) (Product k), where both the sum and product are over those k where 1 <= k <= n/2 and gcd(k,n) = 1.

Original entry on oeis.org

1, 1, 1, 3, 1, 11, 4, 14, 4, 274, 6, 1764, 23, 106, 176, 109584, 47, 1026576, 300, 6960, 1689, 120543840, 552, 26854848, 19524, 7962160, 34986, 283465647360, 1312, 4339163001600, 4098240, 164944640, 4098240, 13833580032, 133542, 22376988058521600, 71697105
Offset: 2

Views

Author

Leroy Quet, Nov 13 2004

Keywords

Examples

			a(8) = (1 + 1/3)*1*3 = 4 because 1 and 3 are those positive integers <= 8/2 and coprime to 8.
		

Crossrefs

Cf. A056855.

Programs

  • Maple
    b:=proc(n) local B,k: B:={}: for k from 1 to n/2 do if gcd(k,n)=1 then B:=B union {k} else B:=B fi od end: a:=proc(n) add(1/b(n)[j],j=1..nops(b(n)))*product(b(n)[j],j=1..nops(b(n))) end: seq(a(n),n=2..40); # Emeric Deutsch, Apr 22 2006
    # second Maple program:
    a:= n-> (l-> mul(i, i=l)*add(1/i, i=l))(
             select(x-> igcd(x, n)=1, [$1..n/2])):
    seq(a(n), n=2..40);  # Alois P. Heinz, May 22 2015
  • Mathematica
    a[n_] := Module[{r = Range[Floor[n/2]], s}, s = Select[r, GCD[#, n]==1&]; Total[1/s] Times @@ s];
    a /@ Range[2, 40] (* Jean-François Alcover, Nov 18 2020 *)

Extensions

More terms from Emeric Deutsch, Apr 22 2006