A350962 a(n) = A068527(2*n).
0, 2, 0, 3, 1, 6, 4, 2, 0, 7, 5, 3, 1, 10, 8, 6, 4, 2, 0, 11, 9, 7, 5, 3, 1, 14, 12, 10, 8, 6, 4, 2, 0, 15, 13, 11, 9, 7, 5, 3, 1, 18, 16, 14, 12, 10, 8, 6, 4, 2, 0, 19, 17, 15, 13, 11, 9, 7, 5, 3, 1, 22, 20, 18, 16, 14, 12, 10, 8, 6, 4, 2, 0, 23, 21, 19, 17, 15
Offset: 0
Keywords
Programs
-
Mathematica
a[n_] := Ceiling[Sqrt[2*n]]^2 - 2*n; Array[a, 100, 0] (* Amiram Eldar, Feb 22 2022 *)
-
Python
from math import isqrt def A350962(n): return 0 if n == 0 else (isqrt(2*n-1)+1)**2-2*n # Chai Wah Wu, Feb 22 2022