OFFSET
1,5
COMMENTS
All numbers occur at least once, but terms > 1 of A000295 appear twice. - Robert G. Wilson v, Apr 19 2006
It appears that a(n) = Sum_{k=0..n-1} (1 + (-1)^A000108(k))/2 (n > 1). - Paul Barry, Mar 31 2008
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..8192
J. B. Conrey, The Riemann Hypothesis, Notices Amer. Math. Soc., 50 (No. 3, March 2003), 341-353. See p. 347.
Will Dana, Eigenvalues of the Redheffer Matrix and their relation to the Mertens function (2015), Theorem 5.
Ralf Stephan, Some divide-and-conquer sequences with (relatively) simple ordinary generating functions.
Ralf Stephan, Table of generating functions.
FORMULA
a(n) = n - A070939(n), n > 1.
a(1)=1, else a(n)=b(n) with b(0)=0, b(2n)=b(n)+n-1, b(2n+1)=b(n)+n. - Ralf Stephan, Oct 11 2003
Except for a(1), a(n) = n - 1 - floor(log(2,n)). - Robert G. Wilson v, Apr 19 2006
It seems that a(n) = A182220(n+1)-1 for all n > 1. - Antti Karttunen, Aug 17 2013
MAPLE
A083058 := proc(n)
if n = 1 then
1;
else
n-floor(log[2](n))-1 ;
end if;
end proc:
seq(A083058(n), n=1..40) ; # R. J. Mathar, Jul 23 2017
MATHEMATICA
a[1] = 1; a[n_] := n - Floor[Log[2, n]] - 1;
Array[a, 100] (* Jean-François Alcover, Feb 27 2019 *)
PROG
(PARI) a(n)=if(n<2, n>0, n-floor(log(n)/log(2))-1)
(PARI) a(n)= if(n<1, 0, valuation( subst( charpoly( matrix(n, n, i, j, (j==1) || (0==j%i))), x, x+1), x))
(Python) def a(n): return n - n.bit_length() + (n == 1) # Matthew Andres Moreno, Jan 04 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Michael Somos, Apr 18 2003
STATUS
approved