login
A298950
Numbers k such that 5*k - 4 is a square.
1
1, 4, 8, 17, 25, 40, 52, 73, 89, 116, 136, 169, 193, 232, 260, 305, 337, 388, 424, 481, 521, 584, 628, 697, 745, 820, 872, 953, 1009, 1096, 1156, 1249, 1313, 1412, 1480, 1585, 1657, 1768, 1844, 1961, 2041, 2164, 2248, 2377, 2465, 2600, 2692, 2833, 2929, 3076, 3176, 3329, 3433
OFFSET
1,2
COMMENTS
a(n) is a member of A140612. Proof: a(n) = n^2 + (n/2-1)^2 for even n, otherwise a(n) = (n-1)^2 + ((n+1)/2)^2; also, a(n) + 1 = (n-1)^2 + (n/2+1)^2 for even n, otherwise a(n) + 1 = n^2 + ((n-3)/2)^2. Therefore, both a(n) and a(n) + 1 belong to A001481.
Primes in sequence are listed in A245042.
Squares in sequence are listed in A081068.
FORMULA
G.f.: x*(1 + x^2)*(1 + 3*x + x^2)/((1 - x)^3*(1 + x)^2).
a(n) = a(1-n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5).
a(n) = (10*n*(n-1) + (2*n-1)*(-1)^n + 9)/8.
a(n) = A036666(n) + 1.
MATHEMATICA
Table[(10 n (n - 1) + (2 n - 1) (-1)^n + 9)/8, {n, 1, 60}]
LinearRecurrence[{1, 2, -2, -1, 1}, {1, 4, 8, 17, 25}, 60] (* Harvey P. Dale, Sep 16 2022 *)
PROG
(PARI) Vec((1+x^2)*(1+3*x+x^2)/((1-x)^3*(1+x)^2)+O(x^60))
(PARI) vector(60, n, nn; (10*n*(n-1)+(2*n-1)*(-1)^n+9)/8)
(Sage) [(10*n*(n-1)+(2*n-1)*(-1)^n+9)/8 for n in (1..60)]
(Maxima) makelist((10*n*(n-1)+(2*n-1)*(-1)^n+9)/8, n, 1, 60);
(Magma) [(10*n*(n-1)+(2*n-1)*(-1)^n+9)/8: n in [1..60]];
(GAP) List([1..60], n -> (10*n*(n-1)+(2*n-1)*(-1)^n+9)/8);
(Python) [(10*n*(n-1)+(2*n-1)*(-1)**n+9)/8 for n in range(1, 60)]
CROSSREFS
Cf. A195162: numbers k such that 5*k + 4 is a square.
Subsequence of A001481, A020668, A036404, A140612.
Cf. A036666, A081068, A106833 (first differences), A245042.
Sequence in context: A158139 A026393 A345432 * A213494 A092321 A366157
KEYWORD
nonn,easy
AUTHOR
Bruno Berselli, Jan 30 2018
STATUS
approved