|
|
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, 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
|
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
Also: append its negated last bit to n-1. - M. F. Hasler, Oct 17 2022
|
|
LINKS
|
|
|
FORMULA
|
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]
a(n) = 4*n - a(n-1) - 1, with a(0) = 1.
a(n) = a(n-1) + a(n-2) - a(n-3). - Ant King, Nov 17 2010
a(n) = (4*n - 3 - (-1)^n)/2. - Ant King, Nov 17 2010
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
|
|
|
MATHEMATICA
|
Select[Range[109], Or[Mod[#, 4] == 1, Mod[#, 4] == 2] &] (* Ant King, Nov 17 2010 *)
CoefficientList[Series[(1 + x + 2 x^2)/((-1 + x)^2 (1 + x)), {x, 0, 20}], x] (* Eric W. Weisstein, Dec 01 2017 *)
|
|
PROG
|
(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]]
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|