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
2, 6, 8, 10, 12, 14, 18, 20, 22, 24, 26, 28, 30, 32, 34, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

Complement of A128201.

LINKS

Michael De Vlieger, Table of n, a(n) for n = 1..10000

FORMULA

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

EXAMPLE

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

MATHEMATICA

Select[Range[2, 130, 2], ! IntegerQ@ Sqrt[#] &] (* Michael De Vlieger, Oct 01 2021 *)

PROG

(PARI) isok(n) = ((n % 2) == 0) && ! issquare(n); \\ Michel Marcus, Aug 26 2013

(Python)

from math import isqrt

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

CROSSREFS

Cf. A088828, A128201, A157512.

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

Sequence in context: A005795 A319827 A327905 * A216032 A076300 A049637

Adjacent sequences:  A157499 A157500 A157501 * A157503 A157504 A157505

KEYWORD

nonn

AUTHOR

Gerald Hillier, Mar 01 2009

EXTENSIONS

More terms from Michel Marcus, Aug 26 2013

STATUS

approved

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 September 26 02:05 EDT 2022. Contains 356986 sequences. (Running on oeis4.)