OFFSET
1,1
COMMENTS
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = A000037(n)^2.
Sum_{n>=1} 1/a(n) = zeta(2) - zeta(4) = A013661 - A013662 = 0.5626108331... - Amiram Eldar, Nov 14 2020
{a(n) : n >= 1} = {A225546(6m+3) : m >= 0}. - Peter Munn, Nov 17 2022
EXAMPLE
a(1)=2^2, a(2)=3^2, a(3)=5^2, a(4)=6^2, a(5)=7^2, ..., a(n)=(integer which is not a perfect square)^2.
MAPLE
a:=proc(n) if type(sqrt(n), integer)=false then n^2 else fi end: seq(a(n), n=1..70); # Emeric Deutsch, Apr 11 2007
MATHEMATICA
a[n_] := (n + Floor[1/2 + Sqrt[n]])^2;
Array[a, 50] (* Jean-François Alcover, Apr 05 2020 *)
PROG
(Magma) [(n + Floor(1/2 + Sqrt(n)))^2: n in [1..60]]; // Vincenzo Librandi, Apr 06 2020
(Python)
from math import isqrt
def A030140(n): return (n+(k:=isqrt(n))+int(n>=k*(k+1)+1))**2 # Chai Wah Wu, Jun 17 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
Edited by N. J. A. Sloane, Jul 02 2008 at the suggestion of R. J. Mathar
STATUS
approved