A117659 Number of solutions to x^(k+2)=x^k mod n for some k>=1.
1, 2, 3, 4, 3, 6, 3, 8, 5, 6, 3, 12, 3, 6, 9, 12, 3, 10, 3, 12, 9, 6, 3, 24, 7, 6, 11, 12, 3, 18, 3, 20, 9, 6, 9, 20, 3, 6, 9, 24, 3, 18, 3, 12, 15, 6, 3, 36, 9, 14, 9, 12, 3, 22, 9, 24, 9, 6, 3, 36, 3, 6, 15, 36, 9, 18, 3, 12, 9, 18, 3, 40, 3, 6, 21
Offset: 1
Examples
For n = 10, using k = 1, the solutions are x = 0, 1, 4, 5, 6, and 9, so a(10) = 6. - _Michael B. Porter_, Jul 08 2016
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000 (terms 1..1000 from Michael De Vlieger)
- Steven R. Finch, Idempotents and Nilpotents Modulo n, arXiv:math/0605019 [math.NT], 2006-2017.
Crossrefs
Cf. A117658.
Programs
-
Mathematica
Table[Sum[Floor[(k^(n + 2) - k^n)/n] - Floor[(k^(n + 2) - k^n - 1)/n], {k, n}], {n, 75}] (* Michael De Vlieger, Jul 07 2016 *) f[2, e_] := If[e < 3, 2^e, 2^(e - 1) + 4]; f[p_, e_] := p^(e - 1) + 2; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 08 2020 *)
-
PARI
a(n) = sum(k=1, n, (k^(n+2)-k^n)\n - (k^(n+2)-k^n -1)\n); \\ Michel Marcus, Jul 07 2016
Formula
a(n) = Sum_{k=1..n} floor((k^(n+2)-k^n)/n)-floor((k^(n+2)-k^n -1)/n). - Anthony Browne, Jul 06 2016
Multiplicative with a(2^e) = 2^e for e < 3 and 2^(e-1) + 4 for e >= 3, and a(p^e) = p^(e-1) + 2 for p > 2. - Amiram Eldar, Sep 08 2020
Comments