cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A253203 The least square larger than n with same parity as n.

This page as a plain text file.
%I A253203 #27 Nov 12 2024 21:10:04
%S A253203 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 A253203 49,36,49,36,49,36,49,36,49,36,49,64,49,64,49,64,49,64,49,64,49,64,49,
%U A253203 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 A253203 The least square larger than n with same parity as n.
%F A253203 a(n) = A256244(n)^2 = n + 2*A256243(n).
%e A253203 9 is the least odd square > 1;
%e A253203 4 is the least even square > 2;
%e A253203 9 is the least odd square > 3.
%t A253203 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 A253203 (Sage)
%o A253203 A = []
%o A253203 for i in [1..100]:
%o A253203     for y in [1..100]:
%o A253203         x = y**2
%o A253203         if x>i and (x-i)%2==0:
%o A253203             A.append(x)
%o A253203             break
%o A253203 A
%Y A253203 Cf. A256243, A256244.
%K A253203 nonn,easy
%O A253203 1,1
%A A253203 _Tom Edgar_ and _Zak Seidov_, Mar 25 2015