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.

A059907 a(n) = |{m : multiplicative order of n mod m = 2}|.

This page as a plain text file.
%I A059907 #22 Jan 26 2025 02:22:26
%S A059907 0,1,2,2,5,2,6,4,6,3,12,2,10,6,8,4,13,2,18,6,10,4,16,4,12,9,12,4,26,2,
%T A059907 20,6,8,12,20,4,15,6,16,4,32,2,24,10,10,6,20,4,26,9,18,4,26,6,32,12,
%U A059907 12,4,28,2,20,10,12,18,25,4,24,6,26,4,52,2,18,10,12,18,26,4,40,8,14,5,28
%N A059907 a(n) = |{m : multiplicative order of n mod m = 2}|.
%C A059907 The multiplicative order of a mod m, GCD(a,m) = 1, is the smallest natural number d for which a^d = 1 (mod m).
%H A059907 Alois P. Heinz, <a href="/A059907/b059907.txt">Table of n, a(n) for n = 1..10000</a>
%F A059907 a(n) = tau(n^2-1)-tau(n-1), where tau(n) = number of divisors of n A000005. Generally, if b(n, r) = |{m : multiplicative order of n mod m = r}| then b(n, r) = Sum_{d|r} mu(d)*tau(n^(r/d)-1), where mu(n) = Moebius function A008683.
%e A059907 a(2) = |{3}| = 1, a(3) = |{4,8}| = 2, a(4) = |{5,15}| = 2, a(5) = |{3,6,8,12,24}| = 5, a(6) = |{7,35}| = 2, a(7) = |{4,8,12,16,24,48}| = 6,...
%p A059907 with(numtheory):f := n->tau(n^2-1)-tau(n-1):for n from 1 to 100 do printf(`%d,`,f(n)) od:
%t A059907 a[n_] := Subtract @@ DivisorSigma[0, {n^2-1, n-1}]; a[1] = 0; Array[a, 100] (* _Amiram Eldar_, Jan 25 2025 *)
%o A059907 (PARI) a(n) = if(n == 1, 0, numdiv(n^2-1) - numdiv(n-1)); \\ _Amiram Eldar_, Jan 25 2025
%Y A059907 Cf. A002329, A059908-A059911, A059499, A059885-A059892, A002326, A053446-A053452, A055205, A048691, A048785, A347191.
%Y A059907 Row n=2 of A212957. - _Alois P. Heinz_, Oct 24 2012
%K A059907 easy,nonn
%O A059907 1,3
%A A059907 _Vladeta Jovovic_, Feb 08 2001