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.

A066947 Number of elements of order 2 in GL(2,Z_n).

Original entry on oeis.org

3, 13, 27, 31, 55, 57, 175, 109, 127, 133, 391, 183, 231, 447, 607, 307, 439, 381, 895, 811, 535, 553, 2463, 751, 735, 973, 1623, 871, 1791, 993, 2335, 1875, 1231, 1855, 3079, 1407, 1527, 2575, 5631, 1723, 3247, 1893, 3751, 3519, 2215, 2257, 8511, 2745
Offset: 2

Views

Author

Alec Mihailovs (alec(AT)mihailovs.com), Jan 24 2002 and Mar 24 2002

Keywords

Examples

			a(3000) = (a(8)+1)*(a(3)+1)*(a(125)+1)-1 = (9*4^2 + 2)*(3^2 + 3 + 2)*(5^6 + 5^5 + 2) - 1 = 46204927 because 3000 = 2^3*3*5^3.
		

Crossrefs

Column 2 of A316566.

Programs

  • Maple
    Ord2inGL2 := proc(n::posint) local i,j,m,c; if n=1 then return 0 end if; m := ifactors(n)[2]; c := 1; j := 1; if (m[1,1]=2) then j := 2; if m[1,2]=1 then c := 4 elif m[1,2]=2 then c := 28 else c := 9*4^(m[1,2]-1)+32 end if end if; c := c*mul((m[i,1]+1)*m[i,1]^(2*m[i,2]-1)+2,i=j..nops(m))-1 end;
  • Mathematica
    a[n_] := (c[0] = 1; c[1] = 4; c[2] = 28; c[k_] := 9*4^(k-1) + 32; fi = FactorInteger[n]; m = (s = Cases[fi, {2, _}]; If[s == {}, 0, s[[1, 2]]]); p = If[m == 0, fi, Rest[fi]]; p1 = p[[All, 1]]; p2 = p[[All, 2]]; c[m]*Times @@ (p1^(2p2) + p1^(2p2-1) + 2) - 1);
    (* Jean-François Alcover, May 19 2011, after Maple prog. *)
  • PARI
    a(n)=my(o=valuation(n,2),f=factor(n>>o)); prod(i=1,#f[,1],f[i,1]^(2*f[i,2])+f[i,1]^(2*f[i,2]-1)+2)*if(o, if(o>1, if(o>2, 9*4^(o-1)+32,28),4),1)-1 \\ Charles R Greathouse IV, May 29 2013

Formula

If n = 2^m*p^a...q^b where p, ..., q are the odd prime divisors of n, then a(n) = c(m)*(p^{2a} + p^{2a-1} + 2)...(q^{2b} + q^{2b-1} + 2) - 1 where c(0) = 1, c(1) = 4, c(2) = 28 and c(m) = 9*4^{m-1} + 32 for m > 2. The integer function f(n) = a(n)+1 is multiplicative, i.e., f(m*n)=f(m)*f(n) for coprime m and n. - Alec Mihailovs (alec(AT)mihailovs.com), Mar 24 2002
a(n) = A066907(n) - 1. - Andrew Howroyd, Jul 08 2018
a(n) = A227867(n) - 1 for odd n. - Jianing Song, Jul 08 2018