login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A126690 Multiplicative function defined for prime powers by a(p^k) = p + p^2 + p^3 + ... + p^(k-1) - 1 (k >= 1). 2
1, -1, -1, 1, -1, 1, -1, 5, 2, 1, -1, -1, -1, 1, 1, 13, -1, -2, -1, -1, 1, 1, -1, -5, 4, 1, 11, -1, -1, -1, -1, 29, 1, 1, 1, 2, -1, 1, 1, -5, -1, -1, -1, -1, -2, 1, -1, -13, 6, -4, 1, -1, -1, -11, 1, -5, 1, 1, -1, 1, -1, 1, -2, 61, 1, -1, -1, -1, 1, -1, -1, 10, -1, 1, -4, -1, 1, -1, -1, -13, 38, 1, -1, 1, 1, 1, 1, -5, -1, 2, 1, -1, 1, 1, 1, -29, -1, -6, -2, 4 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,8
COMMENTS
If we change the definition to a(p^k) = p + p^2 + p^3 + ... + p^k - 1 (k >= 1) we get (-1)sigma(n), A046090.
LINKS
EXAMPLE
a(5) = -1, a(9) = 3-1 = 2, a(45) = (-1)*2 = -2.
MAPLE
pksum := proc(L) local p, k ; p := op(1, L) ; k := op(2, L) ; (p^k-p)/(p-1)-1 ; end: A126690 := proc(n) local pe, a ; if n = 1 then RETURN(1) ; else a := 1 ; pe := ifactors(n)[2] ; for d in pe do a := a*pksum(d) ; od: RETURN(a) ; fi; end: for n from 1 to 120 do printf("%d, ", A126690(n)) ; od: # R. J. Mathar, Aug 08 2008
MATHEMATICA
a[1] = 1;
a[n_] := a[n] = Product[{p, k} = pk; Total[p^Range[k - 1]] - 1, {pk, FactorInteger[n]}];
Array[a, 100] (* Jean-François Alcover, Mar 31 2020 *)
PROG
(Scheme, with memoization-macro definec)
(definec (A126690 n) (cond ((= 1 n) n) ((= 1 (A067029 n)) (- (A126690 (A028234 n)))) (else (* (+ -1 (add (lambda (k) (expt (A020639 n) k)) 1 (- (A067029 n) 1))) (A126690 (A028234 n))))))
;; Auxiliary function add implements sum_{i=lowlim..uplim} intfun(i)
(define (add intfun lowlim uplim) (let sumloop ((i lowlim) (res 0)) (cond ((> i uplim) res) (else (sumloop (1+ i) (+ res (intfun i)))))))
;; Antti Karttunen, Sep 23 2017
CROSSREFS
Sequence in context: A326327 A113103 A033325 * A338945 A263007 A104714
KEYWORD
sign,mult
AUTHOR
N. J. A. Sloane, Feb 14 2008, based on a posting to the Sequence Fans Mailing List by Yasutoshi Kohmoto, Feb 02 2005
EXTENSIONS
Extended beyond a(30) by R. J. Mathar, Aug 08 2008
More terms from Antti Karttunen, Sep 23 2017
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 11:49 EDT 2024. Contains 371936 sequences. (Running on oeis4.)