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.
%I A278846 #38 Jun 11 2024 23:46:16 %S A278846 0,0,0,0,0,8,8,40,48,80,88,152,160,232,264,304,344,448,480,608,648, %T A278846 720,784,944,968,1104,1176,1304,1376,1576,1616,1840,1944,2080,2184, %U A278846 2352,2424,2688,2816,2984,3072,3368,3440,3760,3896,4064,4224,4576,4664,4984,5120 %N A278846 Number of unimodular 2 X 2 matrices having entries in {0,1,...,n} with no entry repeated. %C A278846 a(n) mod 8 = 0. %H A278846 Robert Israel, <a href="/A278846/b278846.txt">Table of n, a(n) for n = 0..1000</a> (terms 0..241 from Indranil Ghosh) %p A278846 df:= proc(n) local count, c,d,q,av,bc,a,b; %p A278846 count:= 0: %p A278846 for d from 1 to n-1 do %p A278846 av:= {$1..n-1} minus {d}; %p A278846 for q in [-1,1] do %p A278846 bc:= n*d+q; %p A278846 for b in numtheory:-divisors(bc) intersect av do %p A278846 c:= bc/b; %p A278846 if c < b and member(c,av) then count:=count+8 fi; %p A278846 od od od; %p A278846 count %p A278846 end proc: %p A278846 ListTools:-PartialSums(map(df, [$0..100])); # _Robert Israel_, Nov 29 2016 %t A278846 df[n_] := Module[{count = 0, c, d, q, av, bc, a, b}, Do[av = Range[n - 1] ~Complement~ {d}; Do[bc = n d + q; Do[c = bc/b; If[c < b && MemberQ[av, c], count += 8], {b, Divisors[bc] ~Intersection~ av}], {q, {-1 , 1}}], {d, 1, n - 1}]; count]; %t A278846 df /@ Range[0, 100] // Accumulate (* _Jean-François Alcover_, Jul 29 2020, after _Robert Israel_ *) %o A278846 (Python) %o A278846 def a(n): %o A278846 s=0 %o A278846 for a in range(0,n+1): %o A278846 for b in range(0,n+1): %o A278846 for c in range(0,n+1): %o A278846 for d in range(0,n+1): %o A278846 if (a!=b and a!=d and b!=d and c!=a and c!=b and c!=d): %o A278846 if abs(a*d-b*c)==1: %o A278846 s+=1 %o A278846 return s %o A278846 print([a(n) for n in range(0, 52)]) # _Indranil Ghosh_, Nov 29 2016 %Y A278846 Cf. A210000 (where the matrix entries can be repeated). %K A278846 nonn %O A278846 0,6 %A A278846 _Indranil Ghosh_, Nov 29 2016