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.
%I A003958 #73 Oct 29 2023 08:22:43 %S A003958 1,1,2,1,4,2,6,1,4,4,10,2,12,6,8,1,16,4,18,4,12,10,22,2,16,12,8,6,28, %T A003958 8,30,1,20,16,24,4,36,18,24,4,40,12,42,10,16,22,46,2,36,16,32,12,52,8, %U A003958 40,6,36,28,58,8,60,30,24,1,48,20,66,16,44,24,70,4,72,36,32,18,60,24,78,4,16 %N A003958 If n = Product p(k)^e(k) then a(n) = Product (p(k)-1)^e(k). %C A003958 Completely multiplicative. %C A003958 Dirichlet inverse of A097945. - _R. J. Mathar_, Aug 29 2011 %H A003958 Daniel Forgues, <a href="/A003958/b003958.txt">Table of n, a(n) for n = 1..100000</a> (first 1000 terms from T. D. Noe) %H A003958 Vaclav Kotesovec, <a href="/A003958/a003958.jpg">Graph - the asymptotic ratio (10^7 terms)</a>. %H A003958 <a href="/index/Di#divseq">Index to divisibility sequences</a> %F A003958 Multiplicative with a(p^e) = (p-1)^e. - _David W. Wilson_, Aug 01 2001 %F A003958 a(n) = A000010(n) iff n is squarefree (see A005117). - _Reinhard Zumkeller_, Nov 05 2004 %F A003958 a(n) = abs(A125131(n)). - _Tom Edgar_, May 26 2014 %F A003958 Sum_{k=1..n} a(k) ~ c * n^2, where c = Pi^4 / (315 * zeta(3)) = 1/(2*A082695) = 0.25725505075419... - _Vaclav Kotesovec_, Jun 14 2020 %F A003958 Dirichlet g.f.: Product_{p prime} 1 / (1 - p^(1-s) + p^(-s)). - _Ilya Gutkovskiy_, Feb 27 2022 %F A003958 Dirichlet g.f.: zeta(s-1) * zeta(s) * Product_{primes p} (1 + (p^(1-s) - 2) / (1 - p + p^s)), (with a product that converges for s=2). - _Vaclav Kotesovec_, Feb 11 2023 %p A003958 a:= n-> mul((i[1]-1)^i[2], i=ifactors(n)[2]): %p A003958 seq(a(n), n=1..80); # _Alois P. Heinz_, Sep 13 2017 %t A003958 DirichletInverse[f_][1] = 1/f[1]; DirichletInverse[f_][n_] := DirichletInverse[f][n] = -1/f[1]*Sum[ f[n/d]*DirichletInverse[f][d], {d, Most[ Divisors[n]]}]; muphi[n_] := MoebiusMu[n]*EulerPhi[n]; Table[ DirichletInverse[ muphi][n], {n, 1, 81}] (* _Jean-François Alcover_, Dec 12 2011, after _R. J. Mathar_ *) %t A003958 a[1] = 1; a[n_] := (fi = FactorInteger[n]; Times @@ ((fi[[All, 1]] - 1)^fi[[All, 2]])); Table[a[n], {n, 1, 50}] (* _G. C. Greubel_, Jun 10 2016 *) %o A003958 (PARI) a(n)=if(n<1,0,direuler(p=2,n,1/(1-p*X+X))[n]) /* _Ralf Stephan_ */ %o A003958 (Haskell) %o A003958 a003958 1 = 1 %o A003958 a003958 n = product $ map (subtract 1) $ a027746_row n %o A003958 -- _Reinhard Zumkeller_, Apr 09 2012, Mar 02 2012 %o A003958 (Python) %o A003958 from math import prod %o A003958 from sympy import factorint %o A003958 def a(n): return prod((p-1)**e for p, e in factorint(n).items()) %o A003958 print([a(n) for n in range(1, 82)]) # _Michael S. Branicky_, Feb 27 2022 %Y A003958 Cf. A003959, A168065, A168066, A027746, A006093, A027748, A124010. %K A003958 nonn,mult,nice %O A003958 1,3 %A A003958 _Marc LeBrun_ %E A003958 Definition reedited (from formula) by _Daniel Forgues_, Nov 17 2009