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!)
A047524 Numbers that are congruent to {2, 7} mod 8. 18

%I #43 Mar 30 2024 11:38:51

%S 2,7,10,15,18,23,26,31,34,39,42,47,50,55,58,63,66,71,74,79,82,87,90,

%T 95,98,103,106,111,114,119,122,127,130,135,138,143,146,151,154,159,

%U 162,167,170,175,178,183,186,191,194,199,202,207,210,215,218,223,226,231,234

%N Numbers that are congruent to {2, 7} mod 8.

%C A195605 is a subsequence. - _Bruno Berselli_, Sep 21 2011

%H Muniru A Asiru, <a href="/A047524/b047524.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 a(n) = 8*n - a(n-1) - 7, n > 1. - _Vincenzo Librandi_, Aug 06 2010

%F From _R. J. Mathar_, Mar 22 2011: (Start)

%F a(n) = 4*n - 3/2 + (-1)^n/2.

%F G.f.: x*(2+5*x+x^2) / ( (1+x)*(x-1)^2 ). (End)

%F From _Franck Maminirina Ramaharo_, Aug 06 2018: (Start)

%F a(n) = 4*n - (n mod 2) - 1.

%F a(n) = A047615(n) + 2.

%F a(2*n) = A004771(n-1).

%F a(2*n-1) = A017089(n-1).

%F E.g.f.: ((8*x - 3)*exp(x) + exp(-x) + 2)/2. (End)

%F a(n) = a(n-1) + a(n-2) - a(n-3). - _Muniru A Asiru_, Aug 06 2018

%F Sum_{n>=1} (-1)^(n+1)/a(n) = (sqrt(2)+2)*Pi/16 - log(2)/8 - sqrt(2)*log(sqrt(2)+1)/8. - _Amiram Eldar_, Dec 11 2021

%p seq(coeff(series(x*(2+5*x+x^2)/((1+x)*(1-x)^2), x,n+1),x,n),n=1..60); # _Muniru A Asiru_, Aug 06 2018

%t Select[Range[300],MemberQ[{2,7},Mod[#,8]]&] (* or *)

%t LinearRecurrence[ {1,1,-1},{2,7,10},60] (* _Harvey P. Dale_, Nov 05 2017 *)

%t CoefficientList[ Series[(x^2 + 5x + 2)/((x - 1)^2 (x + 1)), {x, 0, 60}], x] (* _Robert G. Wilson v_, Aug 07 2018 *)

%o (Maxima) makelist(4*n - mod(n,2) - 1, n, 1, 100); /* _Franck Maminirina Ramaharo_, Aug 06 2018 */

%o (PARI) is(n) = #setintersect([n%8], [2, 7]) > 0 \\ _Felix Fröhlich_, Aug 06 2018

%o (GAP) Filtered([0..250],n->n mod 8=2 or n mod 8=7); # _Muniru A Asiru_, Aug 06 2018

%o (Python)

%o def A047524(n): return (n<<2)-1-(n&1) # _Chai Wah Wu_, Mar 30 2024

%Y Cf. A047398, A047461, A047452, A047470, A047535, A047615, A047617, A195605.

%K nonn,easy

%O 1,1

%A _N. J. A. Sloane_

%E More terms from _Vincenzo Librandi_, Aug 06 2010

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 18 11:52 EDT 2024. Contains 371779 sequences. (Running on oeis4.)