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.

A126690 Multiplicative function defined for prime powers by a(p^k) = p + p^2 + p^3 + ... + p^(k-1) - 1 (k >= 1).

This page as a plain text file.
%I A126690 #21 May 27 2025 01:09:06
%S A126690 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,
%T A126690 -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,
%U A126690 -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
%N A126690 Multiplicative function defined for prime powers by a(p^k) = p + p^2 + p^3 + ... + p^(k-1) - 1 (k >= 1).
%C A126690 If we change the definition to a(p^k) = p + p^2 + p^3 + ... + p^k - 1 (k >= 1) we get (-1)sigma(n), A049060.
%H A126690 Antti Karttunen, <a href="/A126690/b126690.txt">Table of n, a(n) for n = 1..10000</a>
%F A126690 Dirichlet g.f.: zeta(s-1) * zeta(s) * Product_{p prime} (1 - 1/p^(s-1) - 2/p^s + 3/p^(2*s-1)). - _Amiram Eldar_, May 26 2025
%e A126690 a(5) = -1, a(9) = 3-1 = 2, a(45) = (-1)*2 = -2.
%p A126690 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
%t A126690 a[1] = 1;
%t A126690 a[n_] := a[n] = Product[{p, k} = pk; Total[p^Range[k - 1]] - 1, {pk, FactorInteger[n]}];
%t A126690 Array[a, 100] (* _Jean-François Alcover_, Mar 31 2020 *)
%o A126690 (Scheme, with memoization-macro definec)
%o A126690 (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))))))
%o A126690 ;; Auxiliary function add implements sum_{i=lowlim..uplim} intfun(i)
%o A126690 (define (add intfun lowlim uplim) (let sumloop ((i lowlim) (res 0)) (cond ((> i uplim) res) (else (sumloop (1+ i) (+ res (intfun i)))))))
%o A126690 ;; _Antti Karttunen_, Sep 23 2017
%o A126690 (PARI) a(n) = {my(f = factor(n)); prod(i = 1, #f~, (f[i,1]^f[i,2] - 2*f[i,1] + 1)/(f[i,1]-1));} \\ _Amiram Eldar_, May 26 2025
%Y A126690 Cf. A049060.
%K A126690 sign,mult
%O A126690 1,8
%A A126690 _N. J. A. Sloane_, Feb 14 2008, based on a posting to the Sequence Fans Mailing List by _Yasutoshi Kohmoto_, Feb 02 2005
%E A126690 Extended beyond a(30) by _R. J. Mathar_, Aug 08 2008
%E A126690 More terms from _Antti Karttunen_, Sep 23 2017