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.

A157502 Even numbers without the squares.

This page as a plain text file.
%I A157502 #30 Jul 30 2022 19:11:40
%S A157502 2,6,8,10,12,14,18,20,22,24,26,28,30,32,34,38,40,42,44,46,48,50,52,54,
%T A157502 56,58,60,62,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,102,
%U A157502 104,106,108,110,112,114,116,118,120,122,124,126,128,130
%N A157502 Even numbers without the squares.
%C A157502 Complement of A128201.
%H A157502 Michael De Vlieger, <a href="/A157502/b157502.txt">Table of n, a(n) for n = 1..10000</a>
%F A157502 Set R(n) = round(sqrt(2*n)), then a(n) = 2*n + R(n) - (R(n) mod 2).
%e A157502 a(2) = 6 as the next even after 2, i.e., 4 (a perfect square), drops out and is replaced by following even.
%t A157502 Select[Range[2, 130, 2], ! IntegerQ@ Sqrt[#] &] (* _Michael De Vlieger_, Oct 01 2021 *)
%o A157502 (PARI) isok(n) = ((n % 2) == 0) && ! issquare(n); \\ _Michel Marcus_, Aug 26 2013
%o A157502 (Python)
%o A157502 from math import isqrt
%o A157502 def A157502(n): return (k:=n<<1)+(r:=(m:=isqrt(k))+int((k-m*(m+1)<<2)>=1))-(r&1) # _Chai Wah Wu_, Jul 30 2022
%Y A157502 Cf. A088828, A128201, A157512.
%Y A157502 Cf. A000290 (squares), A005843 (even numbers).
%K A157502 nonn
%O A157502 1,1
%A A157502 _Gerald Hillier_, Mar 01 2009
%E A157502 More terms from _Michel Marcus_, Aug 26 2013