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 A187468 #41 Dec 27 2024 02:52:54 %S A187468 1,2,4,40,208,928,3904,16000,64768,260608,1045504,4188160,16764928, %T A187468 67084288,268386304,1073643520,4294770688,17179475968,68718690304, %U A187468 274876334080,1099508482048,4398040219648,17592173461504,70368719011840,281474926379008 %N A187468 Sum of the squares modulo 2^n of the odd numbers less than 2^n. %C A187468 There is a simple formula for this case; the sum of the squares of the odd numbers less than 2^n is A016131(n-1). %C A187468 Can the general case for m^n, m > 2 be calculated with a formula of the same kind? %C A187468 From _R. J. Mathar_, Aug 26 2013: (Start) %C A187468 For n>=3, the sum of the squares of the even numbers less than 2^n (each square mod 2^n) are 8 times the sequence 1, 2, 12, 56, 304, 1376, 6336, 27008 etc. and appear to obey a(n)= +6*a(n-1) -48*a(n-3) +64*a(n-4). %C A187468 For n>=1, the sum of the squares of the odd numbers less than 3^n (modulo 3^n) start as 2 times 1, 12, 144, 1404, 13689, 126360,.. and apparently obey a(n)= +12*a(n-1) -324*a(n-3) +729*a(n-4). %C A187468 For n>=1, the sum of the squares of the odd numbers less than 4^n (modulo 4^n) start as 2 times 1, 28, 688, 13504, 238336,... and seem to obey a(n)= +28*a(n-1) -224*a(n-2) +512*a(n-3). %C A187468 (End) %H A187468 G. C. Greubel, <a href="/A187468/b187468.txt">Table of n, a(n) for n = 1..1000</a> %H A187468 <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (6,-8). %F A187468 For n>2 the sum of all r_j = (c_j)^2 mod 2^n for a particular n is given by 2^(n-1)*(2^(n-1) - 3). %F A187468 From _Colin Barker_, Aug 19 2013: (Start) %F A187468 a(n) = 2^(n-2)*(2^n - 6) for n>2. %F A187468 a(n) = 6*a(n-1) - 8*a(n-2) for n>4. %F A187468 G.f.: x*(1 - 4*x + 32*x^3)/((1-2*x)*(1-4*x)). (End) %F A187468 E.g.f.: (1/4)*(5 + 12*x + 8*x^2 - 6*exp(2*x) + exp(4*x)). - _G. C. Greubel_, Dec 26 2024 %e A187468 For n=5, 2^5=32. The c_j, numbers prime to 32 are the odd numbers less than 32. The r_j = (c_j)^2 mod 32 are 1,9,25,17,17,25,9,1,1,9,25,17,17,25,9,1 = 4*52 = 208. %e A187468 From the formula, for n=5, 2^(5-1) * (2^(5-1) - 3) = 16*13 = 208. %t A187468 Join[{1, 2}, Table[2^(n - 1) (2^(n - 1) - 3), {n, 3, 20}]] %t A187468 LinearRecurrence[{6,-8}, {1,2,4,40}, 40] (* _G. C. Greubel_, Dec 26 2024 *) %o A187468 (Magma) [n le 2 select n else 2^(n-2)*(2^n - 6): n in [1..40]]; // _G. C. Greubel_, Dec 26 2024 %o A187468 (Python) %o A187468 def A187468(n): return pow(2,n-2)*(pow(2,n) -6) +3*int(n==1) +4*int(n==2) %o A187468 print([A187468(n) for n in range(1,41)]) # _G. C. Greubel_, Dec 26 2024 %Y A187468 Cf. A016131. %K A187468 nonn,easy %O A187468 1,2 %A A187468 _J. M. Bergot_, Mar 22 2011 %E A187468 Heavily edited by _Olivier Gérard_, Mar 23 2011 %E A187468 More terms from _Colin Barker_, Aug 19 2013