A050271 Numbers k such that k = floor(sqrt(k)*ceiling(sqrt(k))).
1, 2, 3, 4, 7, 8, 9, 14, 15, 16, 23, 24, 25, 34, 35, 36, 47, 48, 49, 62, 63, 64, 79, 80, 81, 98, 99, 100, 119, 120, 121, 142, 143, 144, 167, 168, 169, 194, 195, 196, 223, 224, 225, 254, 255, 256, 287, 288, 289, 322, 323, 324, 359, 360, 361, 398, 399, 400
Offset: 1
Links
- Ivan Neretin, Table of n, a(n) for n = 1..10000
- Index entries for linear recurrences with constant coefficients, signature (1,0,2,-2,0,-1,1).
Programs
-
Maple
a:=n->floor((n+4)/3)^2+irem(n+1,3)-2: seq(a(n),n=1..58); # Lorenzo Sauras Altuzarra, Jan 31 2023
-
Mathematica
Select[Range@400, Floor[(r = Sqrt@#)*Ceiling@r] == # &] (* Ivan Neretin, Feb 08 2017 *) LinearRecurrence[{1,0,2,-2,0,-1,1},{1,2,3,4,7,8,9},60] (* Harvey P. Dale, Aug 10 2025 *)
-
PARI
isok(n) = floor(sqrt(n)*ceil(sqrt(n))) == n; \\ Michel Marcus, Nov 22 2013
-
PARI
Vec(x*(1 + x + x^2 - x^3 + x^4 - x^5) / ((1 - x)^3*(1 + x + x^2)^2) + O(x^100)) \\ Colin Barker, Feb 09 2017
-
Python
def A050271(n): a, b = divmod(n+4,3) return a**2+b-2 # Chai Wah Wu, Aug 02 2022
Formula
a(n) = floor((n + 4)/3)^2 + ((n + 1) mod 3) - 2. - Ivan Neretin, Feb 08 2017
From Colin Barker, Feb 09 2017: (Start)
a(n) = a(n-1) + 2*a(n-3) - 2*a(n-4) - a(n-6) + a(n-7) for n > 7.
G.f.: x*(1 + x + x^2 - x^3 + x^4 - x^5) / ((1 - x)^3*(1 + x + x^2)^2).
(End)
From Amiram Eldar, Sep 14 2022: (Start)
Sum_{n>=1} 1/a(n) = 2 + Pi^2/6 - cot(sqrt(2)*Pi)*Pi/(2*sqrt(2)).
Sum_{n>=1} (-1)^(n+1)/a(n) = 1 + Pi^2/12 + cosec(sqrt(2)*Pi)*Pi/(2*sqrt(2)). (End)
a(n) = A087278(n+1) - 1 if n > 0. - Lorenzo Sauras Altuzarra, Jan 31 2023
Extensions
Data corrected by Michel Marcus and Benoit Cloitre, Nov 22 2013
Comments