|
|
A171503
|
|
Number of 2 X 2 integer matrices with entries from {0,1,...,n} having determinant 1.
|
|
8
|
|
|
0, 3, 7, 15, 23, 39, 47, 71, 87, 111, 127, 167, 183, 231, 255, 287, 319, 383, 407, 479, 511, 559, 599, 687, 719, 799, 847, 919, 967, 1079, 1111, 1231, 1295, 1375, 1439, 1535, 1583, 1727, 1799, 1895, 1959, 2119, 2167, 2335, 2415, 2511, 2599
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
Number of distinct solutions to k*x+h=0, where |h|<=n and k=1,2,...,n. - Giovanni Resta, Jan 08 2013.
Number of reduced rational numbers r/s with |r|<=n and 0<s<=n. - Juan M. Marquez, Apr 13 2015
|
|
LINKS
|
|
|
FORMULA
|
Recursion: a(n) = a(n - 1) + 4*phi(n) for n > 1, with phi being Euler's totient function. - Juan M. Marquez, Jan 19 2010
|
|
MAPLE
|
with(numtheory):
a:= proc(n) option remember;
`if`(n<2, [0, 3][n+1], a(n-1) + 4*phi(n))
end:
seq(a(n), n=0..60);
|
|
MATHEMATICA
|
a[n_]:=Count[Det/@(Partition[ #, 2]&/@Tuples[Range[0, n], 4]), 1]
(* Second program: *)
a[0] = 0; a[1] = 3; a[n_] := a[n] = a[n-1] + 4*EulerPhi[n];
|
|
PROG
|
(Python)
from functools import lru_cache
@lru_cache(maxsize=None)
if n == 0:
return 0
c, j = 0, 2
k1 = n//j
while k1 > 1:
j2 = n//k1 + 1
j, k1 = j2, n//j2
|
|
CROSSREFS
|
See A326354 for an essentially identical sequence.
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|