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!)
A128201 Union of positive squares and the odd numbers. 6
1, 3, 4, 5, 7, 9, 11, 13, 15, 16, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 36, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 64, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 100, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 123 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
Range of A128200.
Positive numbers n such that n^((1 + n)/2) is an integer. - Gionata Neri, May 07 2016
LINKS
FORMULA
a(n) = f(n,1,1,2), where f(n,i,m,x) = if i=n then m; else if m+1=x^2 then f(n,i+1,m+1,x); else if m+1>x^2 then f(n,i+1,m+1,x+2); else f(n,i+1,m+2,x).
Set R(n) = 2*n - round(sqrt(2*n)); then a(n) = R(n) + sign(frac(sqrt(R(n)))) * (not(R(n) mod 2)). - Gerald Hillier, Apr 16 2015
MATHEMATICA
f[n_] := Block[{s = Range[n]^2, t}, Union[s, Range[1, Last@ s, 2]] // Sort]; f@ 12 (* Michael De Vlieger, Apr 16 2015 *)
PROG
(PARI) A128201(n)=!(bittest(n=2*n-round(sqrt(2*n)), 0)||issquare(n))+n \\ Based on Hiliers's formula. - M. F. Hasler, Apr 19 2015
(PARI) is_A128201(n)=bittest(n, 0)||issquare(n) \\ M. F. Hasler, Apr 19 2015
CROSSREFS
Partial sums given by A157130. - Gerald Hillier, Feb 25 2009
See A176693 for the union of even numbers and the squares. - M. F. Hasler, Apr 19 2015
Sequence in context: A190941 A284752 A161153 * A347301 A233514 A096262
KEYWORD
nonn,easy
AUTHOR
Reinhard Zumkeller, Mar 04 2007
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 April 24 14:23 EDT 2024. Contains 371960 sequences. (Running on oeis4.)