login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A278348 Number of 2 X 2 singular integer matrices with elements from {0,...,n} with no elements repeated. 2

%I #56 Jun 06 2020 12:59:59

%S 0,0,0,0,0,0,16,16,32,40,72,72,136,136,184,248,304,304,408,408,536,

%T 632,712,712,920,968,1064,1168,1360,1360,1664,1664,1848,2008,2136,

%U 2328,2696,2696,2840,3032,3432,3432,3880,3880,4200,4592,4768,4768,5336,5456,5824

%N Number of 2 X 2 singular integer matrices with elements from {0,...,n} with no elements repeated.

%C If p is prime then a(p) = a(p-1). - _Robert G. Wilson v_, Nov 20 2016

%H Indranil Ghosh, Charles R Greathouse IV and Chai Wah Wu, <a href="/A278348/b278348.txt">Table of n, a(n) for n = 0..10000</a> (first 101 terms from Ghosh, next 1900 terms from Charles R Greathouse IV)

%H Charles R Greathouse IV, <a href="/A278348/a278348.c.txt">C program for computing this sequence</a>

%t f[n_] := f[n] = Block[{a = 1, b, c, s = 0}, While[b = a + 1; a < n + 1, While[c = b + 1; b < n + 1, While[c < n + 1, If[a != b && a != c && a != n && b != c && b != n && c != n && a*n == b*c, s++]; c++]; b++]; a++]; 8 s + f[n - 1]]; f[0] = 0; Array[f, 51] (* or *)

%t g[n_] := g[n] = Block[{c = 0, k = 1}, While[k < n, c += Count[ Times @@@ Select[ Tuples[ Rest@ Most@ Divisors[k*n], 2], #[[1]] < #[[2]] < n &], k*n]; k++]; c]; 8*Accumulate[ Array[g, 51]] (* much faster but both are recursive *) (* _Robert G. Wilson v_, Nov 20 2016 *)

%o (Python)

%o def p(n):

%o s=0

%o for a in range(n+1):

%o for b in range(n+1):

%o for c in range(n+1):

%o for d in range(n+1):

%o if (a!=b and a!=d and b!=d and c!=a and c!=b and c!=d):

%o if a*d==b*c:

%o s+=1

%o return s

%o for i in range(101):

%o print(str(i)+" "+str(p(i)))

%o (PARI) try(a,b,c,n)=my(d=b*c/a); denominator(d)==1 && d<=n && d!=a && d!=b && d!=c

%o a(n)=2*sum(a=3,n, sum(b=2,a-1, sum(c=1,b-1, try(a,b,c,n) + try(c,a,b,n) + try(b,a,c,n)))) \\ _Charles R Greathouse IV_, Nov 20 2016

%o (C) See Greathouse link.

%Y Cf. A059306 (where in the matrices each element can be present multiple times).

%K nonn

%O 0,7

%A _Indranil Ghosh_, Nov 18 2016

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 03:15 EDT 2024. Contains 371964 sequences. (Running on oeis4.)