Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #12 Apr 04 2016 06:56:47
%S 1,8,14,26,32,112,58,98,110,256,134,364,184,464,448,386,308,880,382,
%T 832,812,1072,554,1372,752,1472,974,1508,872,3584,994,1538,1876,2464,
%U 1856,2860,1408,3056,2576,3136,1724,6496,1894,3484,3520,4432,2258,5404,2746
%N Number of elements X in the matrix ring M_2(Z_n) such that X^2 == X (mod n).
%t ring[n_] := Flatten[Table[{{a, b}, {c, d}}, {a, 0, n - 1}, {b, 0, n - 1}, {c, 0, n - 1}, {d, 0, n - 1}], 3]; a[n_] := Length@Select[ring[n], Mod[#.#, n] == # &]; Table[a[n], {n, 44}]
%o (PARI) a(n) = sum(i=0, n-1, sum(j=0, n-1, sum(k=0, n-1, sum(l=0, n-1, m = Mod([i,j;k,l], n); m^2 == m)))); \\ _Michel Marcus_, Apr 04 2016
%Y Cf. A087726.
%K nonn,mult
%O 1,2
%A _José María Grau Ribas_, Jun 16 2013