Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #79 Mar 30 2024 02:41:52
%S 1,4,9,12,17,20,25,28,33,36,41,44,49,52,57,60,65,68,73,76,81,84,89,92,
%T 97,100,105,108,113,116,121,124,129,132,137,140,145,148,153,156,161,
%U 164,169,172,177,180,185,188,193,196,201,204,209,212,217,220,225,228,233
%N Numbers that are congruent to {1, 4} mod 8.
%C Maximal number of squares that can be covered by a queen on an n X n chessboard. - _Reinhard Zumkeller_, Dec 15 2008
%H Muniru A Asiru, <a href="/A047461/b047461.txt">Table of n, a(n) for n = 1..5000</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,1,-1).
%F From _R. J. Mathar_, Oct 29 2008: (Start)
%F G.f.: x*(1+3*x+4*x^2)/((1+x)*(1-x)^2).
%F a(n) = a(n-2) + 8.
%F a(n) + a(n+1) = A004770(n).
%F a(n+1) - a(n) = A010703(n). (End)
%F a(n) = 8*floor((n-1)/2) + 4 - 3*(n mod 2). - _Reinhard Zumkeller_, Dec 15 2008
%F a(n) = A153125(n,n). - _Reinhard Zumkeller_, Dec 20 2008
%F a(n) = 8*n - a(n-1) - 11 (with a(1)=1). - _Vincenzo Librandi_, Aug 06 2010
%F a(n) = 4*n - (7 + (-1)^n)/2. - _Arkadiusz Wesolowski_, Sep 18 2012
%F a(1)=1, a(2)=4, a(3)=9, a(n) = a(n-1) + a(n-2) - a(n-3). - _Harvey P. Dale_, Jun 18 2013
%F a(n) = 1 + A004526(n)*3 + A004526(n-1)*5. - _Gregory R. Bryant_, Apr 16 2014
%F From _Franck Maminirina Ramaharo_, Jul 22 2018: (Start)
%F a(n) = A047470(n) + 1.
%F E.g.f.: (8 - exp(-x) + (8*x - 7)*exp(x))/2. (End)
%F Sum_{n>=1} (-1)^(n+1)/a(n) = (sqrt(2)+1)*Pi/16 + log(2)/4 + sqrt(2)*arccoth(sqrt(2))/8. - _Amiram Eldar_, Dec 11 2021
%p seq(coeff(series(factorial(n)*((8-exp(-x)+(8*x-7)*exp(x))/2), x,n+1),x,n),n=1..60); # _Muniru A Asiru_, Jul 23 2018
%t Flatten[(#+{1,4})&/@(8Range[0,30])] (* or *) LinearRecurrence[ {1,1,-1},{1,4,9},60] (* _Harvey P. Dale_, Jun 18 2013 *)
%t CoefficientList[ Series[(4x^2 + 3x + 1)/((x + 1) (x - 1)^2), {x, 0, 58}], x] (* _Robert G. Wilson v_, Jul 24 2018 *)
%o (Maxima) makelist(4*n -(7 + (-1)^n)/2, n, 1, 100); /* _Franck Maminirina Ramaharo_, Jul 22 2018 */
%o (GAP) Filtered([1..250], n->n mod 8=1 or n mod 8 =4); # _Muniru A Asiru_, Jul 23 2018
%o (Magma) [4*n-3 - ((n+1) mod 2): n in [1..70]]; // _G. C. Greubel_, Mar 15 2024
%o (SageMath) [4*n-3 - ((n+1)%2) for n in range(1,71)] # _G. C. Greubel_, Mar 15 2024
%o (Python)
%o def A047461(n): return (n-1<<2)|(n&1) # _Chai Wah Wu_, Mar 30 2024
%Y Cf. A004526, A004770, A010703, A017077, A017113, A047398, A047452.
%Y Cf. A047470, A047524, A047535, A047615, A047617, A153125, A342819.
%K nonn,easy
%O 1,2
%A _N. J. A. Sloane_