OFFSET
1,1
COMMENTS
Gives the number of ways that the product of the values on n different 6-sided dice can be a perfect square. Thus a(n)/6^n is the probability that the product of n different 6-sided dice is a perfect square.
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Math.StackExchange, When the product of dice rolls yields a square
Index entries for linear recurrences with constant coefficients, signature (12,-44,48).
FORMULA
From Colin Barker, Jan 08 2016: (Start)
a(n) = 2^(n - 3)*(2^n + 3^n + 3).
a(n) = 12*a(n-1) - 44*a(n-2) + 48*a(n-3) for n>3.
G.f.: 2*x*(1 - 3*x)*(1 - 5*x) / ((1 - 2*x)*(1 - 4*x)*(1 - 6*x)).
(End)
EXAMPLE
a(1) = 2 because there are two ways for one die to be a perfect square: if its value is 1 or 4.
a(2) = 8 because there are eight ways for the product of the values on two dice to result in perfect squares: 1*1, 1*4, 2*2, 3*3, 4*1, 4*4, 5*5, 6*6.
MAPLE
seq((6^n+4^n+3*2^n)/8, n = 1 .. 40);
PROG
(PARI) a(n) = 2^(n-3)*(2^n+3^n+3) \\ Colin Barker, Jan 08 2016
(PARI) Vec(2*x*(1-3*x)*(1-5*x)/((1-2*x)*(1-4*x)*(1-6*x)) + O(x^30)) \\ Colin Barker, Jan 08 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Nathaniel Johnston, Jan 03 2016
STATUS
approved