login
Numbers that are congruent to {4, 5, 6, 7} mod 8.
9

%I #56 Dec 25 2023 13:45:52

%S 4,5,6,7,12,13,14,15,20,21,22,23,28,29,30,31,36,37,38,39,44,45,46,47,

%T 52,53,54,55,60,61,62,63,68,69,70,71,76,77,78,79,84,85,86,87,92,93,94,

%U 95,100,101,102,103,108,109

%N Numbers that are congruent to {4, 5, 6, 7} mod 8.

%C Numbers having a 1 in position 2 of their binary expansion. One of the mystery calculator sequences: A005408, A042964, A047566, A115419, A115420, A115421. - _Jeremy Gardiner_, Jan 22 2006

%H Reinhard Zumkeller, <a href="/A047566/b047566.txt">Table of n, a(n) for n = 1..1000</a>

%H Maths Magic, <a href="https://web.archive.org/web/20201112033017/http://www.counton.org/explorer/mathsmagic/realmystery/">Mystery Calculator</a>.

%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,1,-1).

%F G.f.: x*(4+x+x^2+x^3+x^4) / ( (1+x)*(1+x^2)*(x-1)^2 ). - _R. J. Mathar_, Oct 08 2011

%F From _Wesley Ivan Hurt_, May 19 2016: (Start)

%F a(n) = a(n-1)+a(n-4)-a(n-5) for n>5.

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

%F E.g.f.: 1 + sin(x) - cos(x) + sinh(x) + 2*x*exp(x). - _Ilya Gutkovskiy_, May 20 2016

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

%p A047566:= n-> n+3 + 4*iquo(n-1, 4):

%p seq(A047566(n), n=1..100); # _Alois P. Heinz_, Aug 22 2011

%t Flatten[# + {4, 5, 6, 7}&/@(8Range[0, 14])] (* _Harvey P. Dale_, Feb 02 2011 *)

%o (Haskell)

%o a047566 n = a047566_list !! (n-1)

%o a047566_list = [n | n <- [1..], mod n 8 > 3]

%o -- _Reinhard Zumkeller_, Dec 29 2012

%Y Cf. A003628 (primes).

%Y Mystery calculator sequences: A005408, A042964, A047566, A115419, A115420, A115421.

%K nonn,easy

%O 1,1

%A _N. J. A. Sloane_