login
Either two less than a square or two more than a square.
4

%I #28 Jun 13 2015 00:54:46

%S 2,3,6,7,11,14,18,23,27,34,38,47,51,62,66,79,83,98,102,119,123,142,

%T 146,167,171,194,198,223,227,254,258,287,291,322,326,359,363,398,402,

%U 439,443,482,486,527,531,574,578,623,627,674,678,727,731,782,786,839,843,898,902,959,963

%N Either two less than a square or two more than a square.

%C Numbers n such that the polynomial x^4 - n*x^2 + 1 is reducible.

%C The corresponding factorizations are (x^2 + k*x - 1)*(x^2 - k*x - 1) == x^4 - (k^2 + 2)*x^2 + 1 and (x^2 + k*x + 1)*(x^2 - k*x + 1) == x^4 - (k^2 - 2)*x^2 + 1. - _Joerg Arndt_, Feb 07 2015

%C Union of A008865 and A059100.

%C For k > 1: a(2*k+1) - a(2*k) = 4 and a(2*k) - a(2*k-1) = k - 1; for n > 4: a(n) - a(n-2) = 2*floor(n/2) + 1 = A109613(n). - _Reinhard Zumkeller_, Feb 10 2015

%H Reinhard Zumkeller, <a href="/A230584/b230584.txt">Table of n, a(n) for n = 1..10000</a>

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

%F From _Colin Barker_, Oct 24 2013: (Start)

%F a(n) = (5-13*(-1)^n+2*(3+(-1)^n)*n+2*n^2)/8 for n>2.

%F a(n) = (n^2+4*n-4)/4 for n>2 and even.

%F a(n) = (n^2+2*n+9)/4 for n>2 and odd.

%F a(n) = a(n-1)+2*a(n-2)-2*a(n-3)-a(n-4)+a(n-5) for n>7.

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

%F After the first two terms 0^2+2 = 2^2-2, 1^2+2, the squares are sufficiently spaced to ensure that the sequence continues 2^2+2, 3^2-2, 3^2+2, 4^2-2, 4^2+2,..., i.e., a(2n-1) = n^2+2, a(2n)=(n+1)^2-2. - _M. F. Hasler_, Oct 26 2013

%o (PARI) is(n)=issquare(n-2)||issquare(n+2)

%o (PARI) A230584_vec(N)=Vec((2+x-x^2-x^3+2*x^5-x^6)/((1-x)^3*(1+x)^2)+O(x^N)) \\ _M. F. Hasler_, Oct 26 2013

%o (Haskell)

%o import Data.List (transpose)

%o a230584 n = a230584_list !! (n-1)

%o a230584_list = 2 : 3 : concat

%o (transpose [drop 2 a059100_list, drop 2 a008865_list])

%o -- _Reinhard Zumkeller_, Feb 10 2015

%Y Cf. A008865, A059100, A000290, A109613.

%K nonn,easy

%O 1,1

%A _Ralf Stephan_, Oct 24 2013