

A042963


Numbers congruent to 1 or 2 mod 4.


51



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
(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 mtuple: 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


LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 1..1000
Eric Weisstein's World of Mathematics, Black Bishop Graph.
Eric Weisstein's World of Mathematics, Maximal Clique.
Index entries for linear recurrences with constant coefficients, signature (1,1,1).


FORMULA

a(n) = 1 + A042948(n1). [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(n1) + 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(n1) + A059841(n1).  Philippe Deléham, Mar 31 2009 [Corrected by Jianing Song, Oct 06 2018]
a(n) = 4*n  a(n1)  1, with a(0) = 1.
a(n) = a(n1) + a(n2)  a(n3).  Ant King, Nov 17 2010
a(n) = (4*n  3  (1)^n)/2.  Ant King, Nov 17 2010
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
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)=1+2*nn%2 \\ This uses offset 0.  Jianing Song, Oct 06 2018
(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 !! (n1)
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: A188258 A308395 A227149 * A264120 A327220 A166097
Adjacent sequences: A042960 A042961 A042962 * A042964 A042965 A042966


KEYWORD

nonn,easy


AUTHOR

N. J. A. Sloane


EXTENSIONS

Offset corrected by Reinhard Zumkeller, Feb 14 2012


STATUS

approved



