login
Numbers m such that 3*m + 4 is a square.
3

%I #56 Jul 26 2024 08:57:47

%S 0,4,7,15,20,32,39,55,64,84,95,119,132,160,175,207,224,260,279,319,

%T 340,384,407,455,480,532,559,615,644,704,735,799,832,900,935,1007,

%U 1044,1120,1159,1239,1280,1364,1407,1495,1540,1632,1679,1775,1824,1924,1975,2079,2132,2240,2295,2407

%N Numbers m such that 3*m + 4 is a square.

%C 7 is the unique prime in this sequence. If m is in this sequence, then 3*m + 4 = k^2 for k is nonzero integer, that is, m = (k^2 - 4)/3 = (k-2)*(k+2)/3. So m can be only prime if one of divisors is prime and another one is 1. Otherwise there should be more than 1 prime divisors, that is n must be composite. - _Altug Alkan_, Apr 12 2016

%C From _Ray Chandler_, Apr 12 2016: (Start)

%C Square roots of resulting squares gives A001651 (with a different starting point).

%C Sequence is the union of (positive terms) in A140676 and A270710. (End)

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

%F O.g.f.: x^2*(4 + 3*x - x^3)/((1 + x)^2*(1 - x)^3).

%F E.g.f.: 1 + (1 - 2*x)*exp(-x)/8 - 3*(3 - 4*x - 2*x^2)*exp(x)/8.

%F a(n) = A001082(n+1) - 1 = (6*n*(n+1) + (2*n + 1)*(-1)^n - 1)/8 - 1. Therefore: a(2*k+1) = k*(3*k+4), a(2*k) = (k+1)*(3*k-1).

%F Sum_{n>=2} 1/a(n) = 19/16 - Pi/(4*sqrt(3)). - _Amiram Eldar_, Jul 26 2024

%e a(4) = 32 because 3*32 + 4 = 100 = 10*10.

%t Select[Range[0,2500], IntegerQ@ Sqrt[3 # + 4] &] (* _Michael De Vlieger_, Apr 12 2016 *)

%t LinearRecurrence[{1,2,-2,-1,1},{0,4,7,15,20},60] (* _Harvey P. Dale_, Dec 09 2016 *)

%o (Magma) [n: n in [0..4000] | IsSquare(3*n+4)];

%o (Python)

%o from gmpy2 import is_square

%o for n in range(0,10**5):

%o if(is_square(3*n+4)):print(n)

%o # _Soumil Mandal_, Apr 12 2016

%Y Cf. A001651, A140676, A270710.

%Y Cf. numbers n such that 3*n + k is a square: A120328 (k=-6), A271713 (k=-5), A056107 (k=-3), A257083 (k=-2), A033428 (k=0), A001082 (k=1), A080663 (k=3), this sequence (k=4), A100536 (k=6).

%K nonn,easy

%O 1,2

%A _Juri-Stepan Gerasimov_, Apr 12 2016

%E Edited and extended by _Bruno Berselli_, Apr 12 2016