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!)
A157502 Even numbers without the squares. 6

%I #30 Jul 30 2022 19:11:40

%S 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 56,58,60,62,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,102,

%U 104,106,108,110,112,114,116,118,120,122,124,126,128,130

%N Even numbers without the squares.

%C Complement of A128201.

%H Michael De Vlieger, <a href="/A157502/b157502.txt">Table of n, a(n) for n = 1..10000</a>

%F Set R(n) = round(sqrt(2*n)), then a(n) = 2*n + R(n) - (R(n) mod 2).

%e a(2) = 6 as the next even after 2, i.e., 4 (a perfect square), drops out and is replaced by following even.

%t Select[Range[2, 130, 2], ! IntegerQ@ Sqrt[#] &] (* _Michael De Vlieger_, Oct 01 2021 *)

%o (PARI) isok(n) = ((n % 2) == 0) && ! issquare(n); \\ _Michel Marcus_, Aug 26 2013

%o (Python)

%o from math import isqrt

%o 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 Cf. A088828, A128201, A157512.

%Y Cf. A000290 (squares), A005843 (even numbers).

%K nonn

%O 1,1

%A _Gerald Hillier_, Mar 01 2009

%E More terms from _Michel Marcus_, Aug 26 2013

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 25 14:55 EDT 2024. Contains 371989 sequences. (Running on oeis4.)