login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A253203 The least square larger than n with same parity as n. 0

%I #24 Mar 17 2020 12:03:02

%S 9,4,9,16,9,16,9,16,25,16,25,16,25,16,25,36,25,36,25,36,25,36,25,36,

%T 49,36,49,36,49,36,49,36,49,36,49,64,49,64,49,64,49,64,49,64,49,64,49,

%U 64,81,64,81,64,81,64,81,64,81,64,81,64,81,64,81,100,81,100,81,100,81,100,81,100,81,100,81,100,81,100,81,100

%N The least square larger than n with same parity as n.

%F a(n) = A256244(n)^2 = n + 2*A256243(n)).

%e 9 is the least odd square > 1;

%e 4 is the least even square > 2;

%e 9 is the least odd square > 3.

%t f[n_] := Block[{s = If[n == 1, Range[3]^2, Range[2 Ceiling@ Sqrt@ n]^2]}, If[EvenQ@ n, SelectFirst[s, EvenQ@ # && # > n &], SelectFirst[s, OddQ@ # && # > n &]]]; Array[f, 120] (* _Michael De Vlieger_, Mar 25 2015 *)

%o (Sage)

%o A = []

%o for i in [1..100]:

%o for y in [1..100]:

%o x = y**2

%o if x>i and (x-i)%2==0:

%o A.append(x)

%o break

%o A

%Y Cf. A256243, A256244.

%K nonn,easy

%O 1,1

%A _Tom Edgar_ and _Zak Seidov_, Mar 25 2015

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 08:20 EDT 2024. Contains 371782 sequences. (Running on oeis4.)