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!)
A022851 a(n) = integer nearest n*x, where x = sqrt(8). 2
0, 3, 6, 8, 11, 14, 17, 20, 23, 25, 28, 31, 34, 37, 40, 42, 45, 48, 51, 54, 57, 59, 62, 65, 68, 71, 74, 76, 79, 82, 85, 88, 91, 93, 96, 99, 102, 105, 107, 110, 113, 116, 119, 122, 124, 127, 130, 133, 136, 139, 141, 144, 147, 150, 153, 156, 158, 161, 164 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
MATHEMATICA
Table[Round[n*Sqrt[8]], {n, 0, 60}] (* G. C. Greubel, Sep 29 2018 *)
PROG
(Magma) [Round(n*Sqrt(8)): n in [0..60]]; // Vincenzo Librandi, Oct 24 2011
(PARI) vector(60, n, n--; round(n*sqrt(8))) \\ G. C. Greubel, Sep 29 2018
(Python)
from math import isqrt
def A022851(n): return (m:=isqrt(k:=n**2<<3))+int((k-m*(m+1)<<2)>=1) # Chai Wah Wu, Jul 29 2022
CROSSREFS
Sequence in context: A342744 A057349 A087068 * A325946 A050503 A265899
KEYWORD
nonn,easy
AUTHOR
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 February 29 11:22 EST 2024. Contains 370425 sequences. (Running on oeis4.)