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 #14 Jan 08 2016 09:34:43
%S 2,8,38,200,1112,6368,37088,218240,1292672,7689728,45874688,274196480,
%T 1640978432,9829081088,58907353088,353175633920,2117979963392,
%U 12703584616448,76204327436288,457157244354560,2742668586647552,16454912005111808,98725073977868288
%N a(n) = (6^n + 4^n + 3*2^n)/8.
%C 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.
%H Colin Barker, <a href="/A266797/b266797.txt">Table of n, a(n) for n = 1..1000</a>
%H Math.StackExchange, <a href="http://math.stackexchange.com/questions/1592140/when-the-product-of-dice-rolls-yields-a-square">When the product of dice rolls yields a square</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (12,-44,48).
%F From _Colin Barker_, Jan 08 2016: (Start)
%F a(n) = 2^(n - 3)*(2^n + 3^n + 3).
%F a(n) = 12*a(n-1) - 44*a(n-2) + 48*a(n-3) for n>3.
%F G.f.: 2*x*(1 - 3*x)*(1 - 5*x) / ((1 - 2*x)*(1 - 4*x)*(1 - 6*x)).
%F (End)
%e a(1) = 2 because there are two ways for one die to be a perfect square: if its value is 1 or 4.
%e 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.
%p seq((6^n+4^n+3*2^n)/8, n = 1 .. 40);
%o (PARI) a(n) = 2^(n-3)*(2^n+3^n+3) \\ _Colin Barker_, Jan 08 2016
%o (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
%K nonn,easy
%O 1,1
%A _Nathaniel Johnston_, Jan 03 2016