OFFSET
0,7
COMMENTS
First several terms agree with A169869 but the two sequences are distinct as can be seen where the values are 19 and 20. - Skip Garibaldi, Mar 05 2017
LINKS
Michael De Vlieger, Table of n, a(n) for n = 0..10000
Burt Totaro, The torsion index of the spin groups, Duke Math. J. 129 (2005), no. 2, 249-290, doi:10.1215/S0012-7094-05-12923-4.
FORMULA
a(n) is usually n-floor(log_2((n+1)n/2 + 1)), but is this number plus 1 if n = 2^e+b for nonnegative integers e, b such that 2b-a(b) <= e-3.
MATHEMATICA
a[0] = 0; a[n_] := a[n] = Module[{e = Floor[Log2@n], b}, b = n - 2^e; n - Floor[Log2[(n + 1) n/2 + 1]] + Boole[2 b - a[b] <= e - 3]]; Table[a@ n, {n, 0, 120}] (* Michael De Vlieger, Mar 06 2017 *)
PROG
(Python)
import numpy as np
def a_typical(n):
'''
For most n, this is the value of a(n)
'''
return int(n - np.floor(np.log2( n*(n+1)/2 + 1)))
def a(n):
'''
The torsion index of Spin_{2n+1} and Spin_{2n+2} is 2^a(n)
Totaro denotes it by u(ell)
'''
if n >= 0 and n <= 18: # Table 1 in Totaro's paper
return [0, 0, 0, 1, 1, 1, 2, 3, 4, 4, 5, 5, 6, 7, 8, 9, 10, 10, 11][n];
maxe = int(np.floor(np.log2(n)))
for e in range(maxe+1):
b = n - 2**e
if 2*b - a(b) <= e - 3: # occurs for n = 8, 16, 32, 33, ...
return a_typical(n)+1
return a_typical(n)
# Skip Garibaldi, Mar 05 2017
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Richard Borcherds (reb(AT)math.berkeley.edu), Jun 28 2004
EXTENSIONS
Edited and a(19)-a(49) added by Skip Garibaldi, Mar 05 2017
More terms from Michael De Vlieger, Mar 06 2017
STATUS
approved
