[go: up one dir, main page]

login
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
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
STATUS
approved