OFFSET
1,5
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 1..10000
Hans L. Bodlaender, Jitender S. Deogun, Klaus Jansen, Ton Kloks, Dieter Kratsch, Haiko Müller, and Zsolt Tuza, Rankings of Graphs, SIAM J. Discrete Math., 11 (1998), 168-181. See p. 179.
Andreas M. Hinz, Sandi Klavžar, and Sara Sabrina Zemljič, A survey and classification of Sierpiński-type graphs, Discrete Applied Math., 217 (2017), 565-600. See Cor. 4.9.
MAPLE
g:=proc(n) option remember; if n = 1 then -1 elif (n mod 2) = 0 then g(n/2) else (n-1)/2 + g((n+1)/2); fi; end;
PROG
(Python)
from functools import lru_cache
@lru_cache(maxsize=None)
def a(n):
if n == 1: return -1
return a(n//2+1) + n//2 if n&1 else a(n//2)
print([a(n) for n in range(1, 91)]) # Michael S. Branicky, Jul 25 2022
CROSSREFS
KEYWORD
sign
AUTHOR
N. J. A. Sloane, May 30 2022, following a suggestion from Don Knuth
STATUS
approved