OFFSET
1,2
COMMENTS
Also denominators of an infinite series which is equal to pi, if the numerators are 1, 1, 1,..., for example: pi = 1/1 + 1/2 + 1/3 + 1/4 + 1/(-5) + 1/6 + 1/7 + 1/8 + 1/9 + 1/(-10) + 1/11 + 1/12 + 1/(-13) + 1/14 ... = 3.14159263... This arises from an infinite series due to Leonhard Euler which is given by: Pi = 1/1 + 1/2 + 1/3 + 1/4 - 1/5 + 1/6 + 1/7 + 1/8 + 1/9 - 1/10 + 1/11 + 1/12 - 1/13 + 1/14 ... = 3.14159263... For another version see A209661.
a(n) = -n if n has an odd number of prime factors of the form 4k+1 (counted with multiplicity), else a(n) = n. - M. F. Hasler, Apr 15 2012
Completely multiplicative because A209661 is. - Andrew Howroyd, Aug 04 2018
REFERENCES
Leonhard Euler, Introductio in analysin infinitorum, 1748.
LINKS
Ray Chandler, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = n*A209661(n).
EXAMPLE
For n = 10 we have that the 10th row of triangle A207338 is [2, -5] therefore a(10) = 2*(-5) = -10.
MATHEMATICA
f[p_, e_] := If[Mod[p, 4] == 1, (-1)^e, 1]; a[n_] := n * Times @@ f @@@ FactorInteger[n]; a[1] = 1; Array[a, 100] (* Amiram Eldar, Sep 06 2023 *)
PROG
(PARI) a(n)={my(f=factor(n)); n*prod(i=1, #f~, my([p, e]=f[i, ]); if(p%4==1, -1, 1)^e)} \\ Andrew Howroyd, Aug 04 2018
CROSSREFS
KEYWORD
sign,frac,easy,mult
AUTHOR
Omar E. Pol, Mar 15 2012
EXTENSIONS
Formula in sequence name from M. F. Hasler, Apr 16 2012
a(34) corrected by Ray Chandler, Mar 19 2016
STATUS
approved