login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 59th year, we have over 358,000 sequences, and we’ve crossed 10,300 citations (which often say “discovered thanks to the OEIS”).

Other ways to Give
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A309945 a(n) = floor(n - sqrt(2*n-1)). 1
0, 0, 0, 1, 2, 2, 3, 4, 4, 5, 6, 7, 8, 8, 9, 10, 11, 12, 12, 13, 14, 15, 16, 17, 18, 18, 19, 20, 21, 22, 23, 24, 24, 25, 26, 27, 28, 29, 30, 31, 32, 32, 33, 34, 35, 36, 37, 38, 39, 40, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 60 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,5

COMMENTS

The subsequence consisting of numbers that appear twice is A007590.

Sequence as triangle:

0;

0;

0; 1, 2;

2, 3, 4;

4, 5, 6, 7, 8;

8, 9, 10, 11, 12;

12, 13, 14, 15, 16, 17, 18;

18, 19, 20, 21, 22, 23, 24;

...

a(1) = 0; for n > 1, a(n) is the number of squares strictly between 2*n - 2 and n^2.

LINKS

Table of n, a(n) for n = 1..999

FORMULA

a(n) = n-1-floor(sqrt(2*n-2)). - Wesley Ivan Hurt, Dec 03 2020

EXAMPLE

For n = 3, 2*n - 2 = 4, n^2 = 9, no square numbers strictly between 4 and 9, a(3) = 0.

For n=5, 2*n - 2 = 8, n^2 = 25, two square numbers (9, 16) strictly between 8 and 25, a(5) = 2.

MATHEMATICA

Table[Floor[n-(2*n-1)^(1/2)], {n, 73}] (* Stefano Spezia, Aug 24 2019 *)

PROG

(PARI) a(n) = floor(n - sqrt(2*n-1)); \\ Jinyuan Wang, Aug 26 2019

(Python)

from math import isqrt

def A309945(n): return (m:=n-1)-isqrt(m<<1) # Chai Wah Wu, Aug 04 2022

CROSSREFS

Cf. A007590, A080476, A016813.

Sequence in context: A122797 A281957 A286389 * A103354 A127038 A175268

Adjacent sequences: A309942 A309943 A309944 * A309946 A309947 A309948

KEYWORD

nonn

AUTHOR

Zhandos Mambetaliyev, Aug 24 2019

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 December 2 11:09 EST 2022. Contains 358493 sequences. (Running on oeis4.)