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!)
A042964 Numbers that are congruent to 2 or 3 mod 4. 34

%I #96 Dec 14 2023 05:29:42

%S 2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31,34,35,38,39,42,43,46,47,

%T 50,51,54,55,58,59,62,63,66,67,70,71,74,75,78,79,82,83,86,87,90,91,94,

%U 95,98,99,102,103,106,107,110,111,114,115,118,119,122,123,126,127

%N Numbers that are congruent to 2 or 3 mod 4.

%C Also numbers m such that binomial(m+2, m) mod 2 = 0. - _Hieronymus Fischer_, Oct 20 2007

%C Also numbers m such that floor(1+(m/2)) mod 2 = 0. - _Hieronymus Fischer_, Oct 20 2007

%C Partial sums of the sequence 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, ... which has period 2. - _Hieronymus Fischer_, Oct 20 2007

%C In groups of four add and divide by two the odd and even numbers. - _George E. Antoniou_, Dec 12 2001

%C From _Jeremy Gardiner_, Jan 22 2006: (Start)

%C Comments on the "mystery calculator". There are 6 cards.

%C Card 0: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, ... (A005408 sequence).

%C Card 1: 2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31, 34, 35, 38, 39, ... (this sequence).

%C Card 2: 4, 5, 6, 7, 12, 13, 14, 15, 20, 21, 22, 23, 28, 29, 30, 31, 36, 37, 38, 39, ... (A047566).

%C Card 3: 8, 9, 10, 11, 12, 13, 14, 15, 24, 25, 26, 27, 28, 29, 30, 31, 40, 41, 42, ... (A115419).

%C Card 4: 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 48, 49, 50, ... (A115420).

%C Card 5: 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, ... (A115421).

%C The trick: You secretly select a number between 1 and 63 from one of the cards. You indicate to me the cards on which that number appears; I tell you the number you selected!

%C The solution: I add together the first term from each of the indicated cards. The total equals the selected number. The numbers in each sequence all have a "1" in the same position in their binary expansion. Example: You indicate cards 1, 3 and 5. Your selected number is 2 + 8 + 32 = 42.

%C Numbers having a 1 in position 1 of their binary expansion. One of the mystery calculator sequences: A005408, A042964, A047566, A115419, A115420, A115421. (End)

%C Complement of A042948. - _Reinhard Zumkeller_, Oct 03 2008

%C Also the 2nd Witt transform of A040000 [Moree]. - _R. J. Mathar_, Nov 08 2008

%C In general, sequences of numbers congruent to {a,a+i} mod k will have a closed form of (k-2*i)*(2*n-1+(-1)^n)/4+i*n+a, from offset 0. - _Gary Detlefs_, Oct 29 2013

%C Union of A004767 and A016825; Fixed points of A098180. - _Wesley Ivan Hurt_, Jan 14 2014, Oct 13 2015

%H David Lovler, <a href="/A042964/b042964.txt">Table of n, a(n) for n = 1..10000</a>

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

%H Pieter Moree, <a href="http://dx.doi.org/10.1016/j.disc.2005.03.004">The formal series Witt transform</a>, Discr. Math. no. 295 vol. 1-3 (2005) 143-160.

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

%F a(n) = A047406(n)/2.

%F From _Michael Somos_, Jan 12 2000: (Start)

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

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

%F a(n) = 2n if n is odd, otherwise n = 2n - 1. - _Amarnath Murthy_, Oct 16 2003

%F a(n) = (3 + (-1)^(n-1))/2 + 2*(n-1) = 2n + 2 - (n mod 2). - _Hieronymus Fischer_, Oct 20 2007

%F A133872(a(n)) = 0. - _Reinhard Zumkeller_, Oct 03 2008

%F a(n) = 4*n - a(n-1) - 3 (with a(1) = 2). - _Vincenzo Librandi_, Nov 17 2010

%F a(n) = 2*n + ((-1)^(n-1) - 1)/2. - _Gary Detlefs_, Oct 29 2013

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

%F E.g.f.: 1 + ((4*x - 1)*exp(x) - exp(-x))/2. - _David Lovler_, Aug 08 2022

%p A042964:=n->2*n+((-1)^(n-1)-1)/2; seq(A042964(n), n=1..100); # _Wesley Ivan Hurt_, Jan 07 2014

%t Flatten[Table[4n + {2, 3}, {n, 0, 31}]] (* _Alonso del Arte_, Feb 07 2013 *)

%t Select[Range[200],MemberQ[{2,3},Mod[#,4]]&] (* or *) LinearRecurrence[ {1,1,-1},{2,3,6},90] (* _Harvey P. Dale_, Nov 28 2018 *)

%o (PARI) a(n)=2*n+2-n%2

%o (Magma) [2*n+((-1)^(n-1)-1)/2 : n in [1..100]]; // _Wesley Ivan Hurt_, Oct 13 2015

%o (Magma) [n: n in [1..150] | n mod 4 in [2, 3]]; // _Vincenzo Librandi_, Oct 13 2015

%o (PARI) Vec((2+x+x^2)/((1-x)*(1-x^2)) + O(x^100)) \\ _Altug Alkan_, Oct 13 2015

%Y Cf. A000040, A133620, A133621, A133622, A133630, A133635.

%Y Cf. A133872, A133882, A133890, A133900, A133910.

%Y Card trick: A005408, A047566, A115419, A115420, A115421.

%Y Cf. A004767, A016825 A040000, A042948, A047406, A098180.

%K nonn,easy

%O 1,1

%A _N. J. A. Sloane_

%E Edited by _N. J. A. Sloane_, Jun 30 2008 at the suggestion of _R. J. Mathar_

%E Corrected by _Jaroslav Krizek_, Dec 18 2009

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 23 02:53 EDT 2024. Contains 371906 sequences. (Running on oeis4.)