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!)
A042963 Numbers congruent to 1 or 2 mod 4. 54
1, 2, 5, 6, 9, 10, 13, 14, 17, 18, 21, 22, 25, 26, 29, 30, 33, 34, 37, 38, 41, 42, 45, 46, 49, 50, 53, 54, 57, 58, 61, 62, 65, 66, 69, 70, 73, 74, 77, 78, 81, 82, 85, 86, 89, 90, 93, 94, 97, 98, 101, 102, 105, 106, 109, 110, 113, 114, 117, 118, 121, 122, 125, 126, 129, 130, 133, 134, 137, 138 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Complement of A014601. - Reinhard Zumkeller, Oct 04 2004
Let S(x) = (1, 2, 2, 2, ...). Then A042963 = ((S(x)^2 + S(x^2))/2 = ((1, 4, 8, 12, 16, 20, ...) + (1, 0, 2, 0, 2, 0, 2, ...))/2 = (1, 2, 5, 6, 9, 10, ...). - Gary W. Adamson, Jan 03 2011
(a(n)*(a(n) + 1 + 4*k))/2 is odd, for k >= 0. - Gionata Neri, Jul 19 2015
Equivalent to the following variation on Fermat's Diophantine m-tuple: 1 + the product of any two distinct terms is not a square; this sequence, which we'll call sequence S, is produced by the following algorithm. At the start, S is initially empty. At stage n, starting at n = 1, the algorithm checks whether there exists a number m already in the sequence, such that mn+1 is a perfect square. If such a number m is found, then n is not added to the sequence; otherwise, n is added. Then n is incremented to n + 1, and we repeat the procedure. Proof by Clark R. Lyons: We prove by strong induction that n is in the sequence S if and only if n == 1 (mod 4) or n == 2 (mod 4). Suppose now that this holds for all k < n. In case 1, either n == 1 (mod 4) or n == 2 (mod 4), and we wish to show that n does indeed enter the sequence S. That is, we wish to show that there does not exist m < n, already in the sequence at this point such that mn+1 is a square. By the inductive hypothesis m == 1 (mod 4) or m == 2 (mod 4). This means that both m and n are one of 1, 2, 5, or 6 mod 8. Using a multiplication table mod 8, we see that this implies mn+1 is congruent to one of 2, 3, 5, 6, or 7 mod 8. But we also see that mod 8, a perfect square is congruent to 0, 1, or 4. Thus mn+1 is not a perfect square, so n is added to the sequence. In case 2, n == 0 (mod 4) or n == 3 (mod 4), and we wish to show that n is not added to the sequence. That is, we wish to show that there exists m < n already in the sequence such that mn+1 is a perfect square. For this we let m = n - 2, which is positive since n >= 3. By the inductive hypothesis, since m == 1 (mod 4) or m == 2 (mod 4) and m < n, m is already in the sequence. And we have m*n + 1 = (n - 2)*n + 1 = n^2 - 2*n + 1 = (n - 1)^2, so mn+1 is indeed a perfect square, and so n is not added to the sequence. Thus n is added to the sequence if and only if n == 1 (mod 4) or n == 2 (mod 4). This completes the proof. - Robert C. Lyons, Jun 30 2016
Also the number of maximal cliques in the (n + 1) X (n + 1) black bishop graph. - Eric W. Weisstein, Dec 01 2017
Lexicographically earliest sequence of distinct positive integers such that the average of any two or more consecutive terms is never an integer. (For opposite property see A005408.) - Ivan Neretin, Dec 21 2017
Numbers whose binary reflected Gray code (A014550) ends with 1. - Amiram Eldar, May 17 2021
Also: append its negated last bit to n-1. - M. F. Hasler, Oct 17 2022
LINKS
David Lovler, Table of n, a(n) for n = 1..10000 (first 1000 terms from Reinhard Zumkeller)
Eric Weisstein's World of Mathematics, Black Bishop Graph.
Eric Weisstein's World of Mathematics, Maximal Clique.
FORMULA
a(n) = 1 + A042948(n-1). [Corrected by Jianing Song, Oct 06 2018]
From Michael Somos, Jan 12 2000: (Start)
G.f.: x*(1 + x + 2*x^2)/((1 - x)^2*(1 + x)).
a(n) = a(n-1) + 2 + (-1)^n, a(0) = 1. (End) [This uses offset 0. - Jianing Song, Oct 06 2018]
A014493(n) = A000217(a(n)). - Reinhard Zumkeller, Oct 04 2004, Feb 14 2012
a(n) = Sum_{k=0..n} (A001045(k) mod 4). - Paul Barry, Mar 12 2004
A145768(a(n)) is odd. - Reinhard Zumkeller, Jun 05 2012
a(n) = A005843(n-1) + A059841(n-1). - Philippe Deléham, Mar 31 2009 [Corrected by Jianing Song, Oct 06 2018]
a(n) = 4*n - a(n-1) - 5 for n > 1. [Corrected by Jerzy R Borysowicz, Jun 09 2023]
From Ant King, Nov 17 2010: (Start)
a(n) = a(n-1) + a(n-2) - a(n-3).
a(n) = (4*n - 3 - (-1)^n)/2. (End)
a(n) = (n mod 2) + 2*n - 2. - Wesley Ivan Hurt, Oct 10 2013
A163575(a(n)) = n - 1. - Reinhard Zumkeller, Jul 22 2014
E.g.f.: 2 + (2*x - 1)*sinh(x) + 2*(x - 1)*cosh(x). - Ilya Gutkovskiy, Jun 30 2016
E.g.f.: 2 + (2*x - 1)*exp(x) - cosh(x). - David Lovler, Jul 19 2022
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi/8 + log(2)/4. - Amiram Eldar, Dec 05 2021
MAPLE
A046923:=n->(n mod 2) + 2n - 2; seq(A046923(n), n=1..100); # Wesley Ivan Hurt, Oct 10 2013
MATHEMATICA
Select[Range[109], Or[Mod[#, 4] == 1, Mod[#, 4] == 2] &] (* Ant King, Nov 17 2010 *)
Table[(4 n - 3 - (-1)^n)/2, {n, 20}] (* Eric W. Weisstein, Dec 01 2017 *)
LinearRecurrence[{1, 1, -1}, {1, 2, 5}, 20] (* Eric W. Weisstein, Dec 01 2017 *)
CoefficientList[Series[(1 + x + 2 x^2)/((-1 + x)^2 (1 + x)), {x, 0, 20}], x] (* Eric W. Weisstein, Dec 01 2017 *)
PROG
(PARI) a(n)=2*n-1-(n-1)%2 \\ Jianing Song, Oct 06 2018; adapted to offset by Michel Marcus, Sep 09 2022
(PARI) apply( A042963(n)=n*2-2+n%2, [1..99]) \\ M. F. Hasler, Oct 17 2022
(Magma) [ n : n in [1..165] | n mod 4 eq 1 or n mod 4 eq 2 ] // Vincenzo Librandi, Jan 25 2011
(Haskell)
a042963 n = a042963_list !! (n-1)
a042963_list = [x | x <- [0..], mod x 4 `elem` [1, 2]]
-- Reinhard Zumkeller, Feb 14 2012
CROSSREFS
Cf. A153284 (first differences), A014848 (partial sums).
Cf. A014550, A046712 (subsequence).
Union of A016813 and A016825.
Sequence in context: A308395 A227149 A264120 * A327220 A166097 A285502
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
Offset corrected by Reinhard Zumkeller, Feb 14 2012
More terms by David Lovler, Jul 19 2022
STATUS
approved

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 July 23 16:47 EDT 2024. Contains 374552 sequences. (Running on oeis4.)