New answers tagged

3

Here's a solution if you're willing to truncate the infinite sums. (* a deterministic random sequence... *) a[n_] := a[n] = BlockRandom[SeedRandom[n]; RandomReal[]/n] A[n_] := A[n] = Total[a /@ Range[n]] lhs[p_?NumericQ, cap_] := Sum[(A[n]/n)^p, {n, 1, cap}] rhs[p_?NumericQ, cap_] := (p/(p - 1))^p Sum[a[n]^p, {n, 1, cap}] Plot[{lhs[p, 1000], rhs[p, 1000]...


4

The lazy user just looking to solve equations can simply use Solve[4 x == 1, x, Modulus -> 5] and be done with it. However, one should recognize that this is in fact a modular inversion problem, and that there are specialized number-theoretic tools for dealing with this directly. All of this hinges on Bézout's identity, which says that for two nonzero ...


3

Here's a copy + paste from my init.m file: JordanTotient[1, n_] := EulerPhi[n] JordanTotient[_, 0] = 0; JordanTotient[_, -1|1] = 1; JordanTotient[k_, n_Integer] := With[{pdiv = PrimeDivisors[n]}, Abs[n]^k Product[1 - 1/p^k, {p, pdiv}] /; ListQ[pdiv] ] JordanTotient /: MakeBoxes[JordanTotient[k_, n_], TraditionalForm] := MakeBoxes[Subscript[J,...


4

Mathematica code given by Enrique Pérez Herrero at OEIS A007434 Clear[jordanTotient] jordanTotient[n_, k_: 1] := DivisorSum[n, #^k*MoebiusMu[n/#] &] /; (n > 0) && IntegerQ[n]; This could also be written as Clear[jordanTotient] jordanTotient[n_Integer?Positive, k_: 1] := DivisorSum[n, #^k*MoebiusMu[n/#] &]; For k=1 this is ...



Top 50 recent answers are included