OFFSET
0,4
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..4095
Eric Rowland and Reem Yassawi, Automatic congruences for diagonals of rational functions, Journal de théorie des nombres de Bordeaux, Vol. 27, No. 1 (2015), pp. 245-288; arXiv preprint, arXiv:1310.8635 [math.NT], 2013-2014.
FORMULA
(-1)^a(n) = A186035(n).
From Amiram Eldar, Aug 26 2024: (Start)
Results from Rowland and Yassawi (2015):
0 <= a(n) <= 2.
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Sum_{k=0..2} d(k) * k = 1/2, where d(k) is the asymptotic density of the occurrences of k in this sequence: d(0) = 2/3, and d(1) = d(2) = 1/6. (End)
MAPLE
A186034 := proc(n)
local m, ml ;
m := A001006(n) ;
ml := %/2^n ;
m/numer(ml) ;
ilog2(%) ;
end proc:
seq(A186034(n), n=0..80) ; # R. J. Mathar, Feb 13 2015
MATHEMATICA
IntegerExponent[RecurrenceTable[(n + 4) M[n + 2] - (2 n + 5) M[n + 1] - 3 (n + 1) M[n] == 0 && M[0] == M[1] == 1, M[n], {n, 0, 127}], 2] (* Eric Rowland, May 06 2013 *)
PROG
(Python)
from itertools import count, islice
def A186034_gen(): # generator of terms
a, b = 1, 1
yield from (0, 0)
for n in count(2):
a, b = b, (b*(2*n+1)+a*3*(n-1))//(n+2)
yield (~b&b-1).bit_length()
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul Barry, Feb 11 2011
EXTENSIONS
Definition edited by Eric Rowland, May 06 2013
More terms from Antti Karttunen, Aug 12 2017
STATUS
approved