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.

Showing 1-3 of 3 results.

A244342 a(n) = phi(n)*h(n) where phi() is the Euler totient function, A000010, and h() is A092089.

Original entry on oeis.org

1, 2, 6, 8, 12, 12, 18, 32, 30, 24, 30, 48, 36, 36, 72, 96, 48, 60, 54, 96, 108, 60, 66, 192, 100, 72, 126, 144, 84, 144, 90, 256, 180, 96, 216, 240, 108, 108, 216, 384, 120, 216, 126, 240, 360, 132, 138, 576, 210, 200, 288, 288, 156, 252, 360, 576, 324, 168
Offset: 1

Views

Author

Michel Marcus, Jun 26 2014

Keywords

Comments

a(n) = Sum_{k=1..n} gcd(k^2-1, n) for those k that are coprime to n (see proof in link).
Multiplicative because both A000010 and A092089 are. - Andrew Howroyd, Jul 26 2018

Crossrefs

Programs

  • Maple
    A244342:= proc(n) add(`if`(igcd(k,n)=1,igcd(k^2-1,n),0),k=1..n) end proc;
    seq(A244342(i),i=1..1000); # Robert Israel, Jul 06 2014
  • Mathematica
    h[n_] := Product[{p, e} = pe; Which[OddQ[p], 2 e + 1, p == 2 && e == 1, 2, True, 4 (e - 1)], {pe, FactorInteger[n]}]; h[1] = 1;
    a[n_] := EulerPhi[n] h[n];
    Array[a, 100] (* Jean-François Alcover, Apr 08 2020 *)
  • PARI
    a(n) = sum(j=1, n, gcd(j^2-1,n)*(gcd(j,n)==1));

A307000 Number of unitary rings with additive group (Z/nZ)^2. Equivalently, number of unitary commutative rings with additive group (Z/nZ)^2.

Original entry on oeis.org

1, 3, 3, 6, 3, 9, 3, 10, 5, 9, 3, 18, 3, 9, 9, 14, 3, 15, 3, 18, 9, 9, 3, 30, 5, 9, 7, 18, 3, 27, 3, 18, 9, 9, 9, 30, 3, 9, 9, 30, 3, 27, 3, 18, 15, 9, 3, 42, 5, 15, 9, 18, 3, 21, 9, 30, 9, 9, 3, 54, 3, 9, 15, 22, 9, 27, 3, 18, 9, 27, 3, 50, 3, 9, 15, 18, 9, 27
Offset: 1

Views

Author

Jianing Song, Mar 24 2019

Keywords

Comments

Equivalently, a(n) is the number of nonisomorphic unitary rings whose rank is 2 when viewed as a free module over the ring (Z_n, +, *). - Jianing Song, Feb 23 2021
Every unitary ring with additive group (Z/nZ)^2 must be commutative, and is of the form Z_n[x]/(x^2 + b*x + c) for some b, c in Z_n, where (x^2 + b*x + c) stands for the ideal of Z_n[x] generated by x^2 + b*x + c. Proof: Let R be a unitary commutative ring with additive group (Z/nZ)^2. Suppose e is the identity element of R, x is an element such that {e, x} is a basis for R as a free module over Z_n (such a basis must exist, see my note in the link section), then every element can be written as the form u*x + v*e for 0 <= u, v <= n-1. If x^2 = -p*x - q*e, it turns out that R is isomorphic to Z_n[x]/(x^2 + [p]*x + [q]). - Jianing Song, Apr 23 2021
Equivalently, a(n) is the number of nonisomorphic rings of the form Z[x]/(n, x^2 + p*x + q), where (n, x^2 + p*x + q) is the ideal of Z[x] generated by n and x^2 + p*x + q. - Jianing Song, Feb 15 2021
Theorem. R_1 = Z_n[x]/(x^2 + b*x + c) and R_2 = Z_n[y]/(y^2 + b'*y + c') are isomorphic if and only if there exists some k in Z, t in Z_n such that gcd(k, n) = 1 and that b' == b*k + 2*t (mod n), c' == t^2 + b*k*t + c*k^2 (mod n).
Proof: "<=": Note that y^2 + (b*k + 2*t)*y + (t^2 + b*k*t + c*k^2) = (y + t)^2 + b*k*(y + t) + c*k^2, so a mapping from R_1 to R_2 is given by f(x) = (y + t)/k and f(r*x + s) = r*f(x) + s. Since gcd(k, n) = 1, f is an isomorphic mapping.
"=>": If R_1 and R_2 are isomorphic, there exists some isomorphic mapping from R_2 to R_1 such that f(y) = k*x - t. If gcd(k, n) > 1, since f(r*y + s) = r*f(y) + s = r*(k*x - t), there is no element in R_2 such that f(y) = x, a contradiction. So this isomorphic mapping sends x in R_1 to (y + t)/k, then (y + t)^2 + b*k*(y + t) + c*k^2 = 0. The corresponding coefficients must be equal modulo n, so b' == b*k + 2*t (mod n), c' == t^2 + b*k*t + c*k^2 (mod n).
Now note that without loss of generality we can suppose that b = 0 or -1, because we can always find some t such that b*k + 2*t == 0 or -1 (mod n). Furthermore, if n is an odd number, we can suppose that b = 0.
Case (i): n is an odd number, then a unitary ring with additive group (Z/nZ)^2 is of the form Z_n[x]/(x^2 - c). From the theorem above we can see that R_1 = Z_n[x]/(x^2 - c) and R_2 = Z_n[y]/(y^2 - c') are isomorphic if and only if there exists some k such that gcd(k, n) = 1 and that c*k^2 == c' (mod n). So the number of such rings is A092089(n).
Case (ii): n is an even number, then a unitary ring with additive group (Z/nZ)^2 is of the form Z_n[x]/(x^2 - c) or Z_n[x]/(x^2 - x - (c - 1)/4), c in Z_{4n}, c == 1 (mod 4). From the theorem above we can see that R_1 = Z_n[x]/(x^2 - c) and R_2 = Z_n[y]/(y^2 - c') are isomorphic if and only if there exists some k such that gcd(k, n) = 1 and that c*k^2 == c' (mod n) or c*k^2 + n^2/4 == c' (mod n) (with t = 0 and t = n/2 respectively); R_3 = Z_n[x]/(x^2 - x - (c - 1)/4)) and R_4 = Z_n[y]/(y^2 - y - (c' - 1)/4)) are isomorphic if and only if there exists some k such that gcd(k, 4*n) = 1 and that c*k^2 == c' (mod 4*n) or c*k^2 - n^2 + 2*n == c' (mod 4*n) (with t = (k - 1)/2 and t = (n + k - 1)/2 respectively).
(a) if n == 2 (mod 4), then the number of rings of the form is Z_n[x]/(x^2 - c) is A092089(n/2), and the number of rings of the form Z_n[x]/(x^2 - x - (c - 1)/4) is equal to the number of inequivalent residue classes modulo 4*n that are congruent to 1 modulo 4 where the equivalence relation is defined as [a] ~ [b] (mod 4*n) if and only if there exists some k such that gcd(k, 4*n) = 1 and that a*k^2 == b (mod 4*n). The number of the even inequivalent residue classes modulo 4*n is equal to the number of inequivalent residue classes modulo 2*n, and the number of inequivalent residue classes modulo 4*n that are congruent to 1 modulo 4 is equal to the number of those that are congruent to 3 modulo 4. So the total number if A092089(n/2) + (A092089(4*n) - A092089(2*n))/2.
(b) if n == 0 (mod 4). Similarly, the number of rings of the form is Z_n[x]/(x^2 - c) is A092089(n), and the number of rings of the form Z_n[x]/(x^2 - x - (c - 1)/4) is (A092089(2*n) - A092089(n))/2.

Examples

			The nonisomorphic unitary rings with additive group (Z/nZ)^2 (rings of the form Z_n[x]/(x^2 + b*x + c)) are given by Z_n[x]/(f(x)), where f(x) =
n = 1: x^2 (total number = 1);
n = 2: x^2, x^2 - x, x^2 - x - 1 (total number = 3);
n = 3: x^2, x^2 - 1, x^2 - 2 (total number = 3);
n = 4: x^2, x^2 - 1, x^2 - 2, x^2 - 3, x^2 - x, x^2 - x - 1 (total number = 6);
n = 5: x^2, x^2 - 1, x^2 - 2 (total number = 3);
n = 6: x^2, x^2 - 1, x^2 - 2, x^2 - x, x^2 - x - 1, x^2 - x - 2, x^2 - x - 3, x^2 - x - 4, x^2 - x - 5 (total number = 9);
n = 7: x^2, x^2 - 1, x^2 - 3 (total number = 3);
n = 8: x^2, x^2 - 1, x^2 - 2, x^2 - 3, x^2 - 4, x^2 - 5, x^2 - 6, x^2 - 7, x^2 - x, x^2 - x - 1 (total number = 10);
n = 9: x^2, x^2 - 1, x^2 - 2, x^2 - 3, x^2 - 6 (total number = 5);
n = 10: x^2, x^2 - 1, x^2 - 2, x^2 - x, x^2 - x - 1, x^2 - x - 3, x^2 - x - 4, x^2 - x - 5, x^2 - x - 6 (total number = 9).
See the link for rings of the form Z_n[x]/(x^2 + b*x + c) for n <= 100.
		

Crossrefs

Programs

  • Mathematica
    f[2, e_] := If[e == 1, 3, 4*e - 2]; f[p_, e_] := 2*e+1; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 17 2020 *)
  • PARI
    a(n)=
    {
        my(r=1, f=factor(n));
        for(j=1, #f[, 1], my(p=f[j, 1], e=f[j, 2]);
            if(p>=3, r*=(2*e+1));
            if(p==2&&e==1, r*=3);
            if(p==2&&e>=2, r*=4*e-2);
        );
        return(r);
    }

Formula

a(n) = A092089(n) if n is odd; (A092089(n) + A092089(2*n))/2 if n is even.
Multiplicative with a(p^e) = 2*e + 1, a(2) = 3 and a(2^e) = 4*e - 2 for e >= 2.
Dirichlet g.f.: zeta(s)^3/zeta(2s)*(1/(1+2^(-s))).
Sum_{k=1..n} a(k) ~ (2*n/Pi^2) * (log(n)^2 + c_1 * log(n) + c_2), where c_1 = 6 * gamma - 2 + 2*log(2)/3 - 4*zeta'(2)/zeta(2) = 4.2052360821..., gamma is Euler's constant (A001620), c_2 = 2 - 6*gamma + 6*gamma^2 - 2*log(2)/3 + 2*gamma*log(2) - log(2)^2/9 - 6*gamma_1 + 4*(1 - 3*gamma - log(2)/3)*zeta'(2)/zeta(2) + 8*(zeta'(2)/zeta(2))^2 - 4*zeta''(2)/zeta(2) = 1.2136692558..., and gamma_1 is the first Stieltjes constant (A082633). - Amiram Eldar, Dec 22 2023

Extensions

New name from Jianing Song, Feb 15 2021
New name from Jianing Song, Apr 23 2021

A092147 Number of even-length palindromes among the k-tuples of partial quotients of the continued fraction expansions of n/r, r=1,...,n.

Original entry on oeis.org

0, 1, 0, 1, 2, 1, 0, 1, 0, 5, 0, 1, 2, 1, 2, 1, 2, 1, 0, 5, 0, 1, 0, 1, 4, 5, 0, 1, 2, 5, 0, 1, 0, 5, 2, 1, 2, 1, 2, 5, 2, 1, 0, 1, 2, 1, 0, 1, 0, 9, 2, 5, 2, 1, 2, 1, 0, 5, 0, 5, 2, 1, 0, 1, 8, 1, 0, 5, 0, 5, 0, 1, 2, 5, 4, 1, 0, 5, 0, 5, 0, 5, 0, 1, 8, 1, 2, 1, 2, 5, 2, 1, 0, 1, 2, 1, 2, 1, 0, 9, 2, 5, 0, 5, 2
Offset: 1

Views

Author

John W. Layman, Mar 31 2004

Keywords

Comments

Suggested by R. K. Guy, Mar 26 2004.
Theorem. Let n=2^a*p1^a1*p2^a2*...*pk^ak*q, where the pi are distinct primes of the form 4m+1 and q contains only primes of the form 4m+3. Then a(n) is given by (1) 0, if a=0 and k=0, (2) 1, if a>0 and k=0, (3) Sum[2^t*s_t(a1,a2,...,ak), if a=0 and k>0 and (4) 1+Sum[2^(t+1)*s_t(a1,a2,...,ak), if a>0 and k>0, where the s_i are the symmetric polynomials s1(a1,a2a,...,ak)=a1+a2+...+ak, s2(a1,a2,...ak)=a1a2+a1a3+...+a2a3+a2a4+...+...+a(k-1)ak, etc. - James E. Shockley (shockley(AT)math.vt.edu), Jul 13 2004

Crossrefs

Cf. A092089.

Formula

Conjecture. Let n=(2^r)(p^s) where p is an odd prime and s>0. Then if p=4k+1, we have a(n)=2s if r=0, a(n)=4s+1 if r>0. On the other hand, if p=4k+3, we get a(n)=0 if r=0, a(n)=1 if r>0. Finally, if n=2^r we get a(n)=1.
Showing 1-3 of 3 results.