login
a(n) = the smallest square > n-th prime.
8

%I #13 Apr 04 2021 08:51:00

%S 4,4,9,9,16,16,25,25,25,36,36,49,49,49,49,64,64,64,81,81,81,81,100,

%T 100,100,121,121,121,121,121,144,144,144,144,169,169,169,169,169,196,

%U 196,196,196,196,225,225,225,225,256,256,256,256,256,256,289,289,289,289

%N a(n) = the smallest square > n-th prime.

%H Vincenzo Librandi, <a href="/A145445/b145445.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = A104103(n)^2.

%t Table[Ceiling[Prime[n]^(1/2)]^2,{n,100}]

%o (Haskell)

%o a145445 n = a145445_list !! (n-1)

%o a145445_list = f a000040_list $ drop 2 a000290_list where

%o f ps'@ (p:ps) xs'@(x:xs) = if p < x then x : f ps xs' else f ps' xs

%o -- _Reinhard Zumkeller_, Jul 25 2014

%o (Python)

%o from sympy import prime, integer_nthroot

%o def a(n): return (integer_nthroot(prime(n), 2)[0]+1)**2

%o print([a(n) for n in range(1, 59)]) # _Michael S. Branicky_, Apr 04 2021

%Y Cf. A104103.

%Y Cf. A000040, A000290, A014085 (run lengths), A245508.

%K nonn

%O 1,1

%A _Zak Seidov_, Oct 10 2008