login

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 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A340507
a(n) = floor(sqrt(2*n)) - A003056(n).
1
0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0
OFFSET
0
COMMENTS
This is A172471 - A003056.
Conjecture: This is an unsigned version of A072785.
LINKS
PROG
(PARI) a(n) = sqrtint(2*n) - (sqrtint(8*n+1)-1)\2; \\ Michel Marcus, Jan 25 2021
(Python)
from math import isqrt
def A340507(n): return isqrt(m:=n<<1)-(isqrt((m<<2)+1)-1>>1) # Chai Wah Wu, Aug 09 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Jan 25 2021
STATUS
approved