OFFSET
0,3
COMMENTS
Consider infinite 0-1 matrix (which expands left and down).
Last column is 010101 ... (alters every step)
Previous is 00110011 ... (alters every 2 steps)
Previous to previous is 000111000111 ... (alters every 3 steps)
Etc. ...
Now a(n) are values of binary numbers coded by rows.
FORMULA
a(0) = 0;
a(n) = \sum_{k=1}^n 2^{k-1}\odd(n \div k)
MAPLE
Contribution from R. J. Mathar, Oct 08 2010: (Start)
A175879 := proc(n) local a, k, ndivk ; a := 0 ; for k from 1 to n do ndivk := floor(n/k) ; if type(ndivk, 'odd') then a := a+2^(k-1) ; fi ; end do: a ; end proc:
seq(A175879(n), n=0..40) ; (End)
MATHEMATICA
f[n_] := Sum[ If[ OddQ[ Floor[ n/k]], 2^(k - 1), 0], {k, n}]; Array[f, 32, 0]
PROG
Contribution from Kamburelis Anastasios (akamb(AT)epp.teicrete.gr), Oct 09 2010: (Start)
(Other) (* Pascal pseudo code *)
var n, a, p, k : integer;
readln(n); (* read index *)
p:= 1; (* powers of 2 *)
a:= 0;
for k:= 1 to n do
begin
if odd( n div k ) then a:= a+p;
p:= 2*p
end;
writeln(a); (* here a = a(n) *)
(End)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Kamburelis Anastasios (akamb(AT)epp.teicrete.gr), Oct 07 2010
EXTENSIONS
Extended by R. J. Mathar, Oct 08 2010
STATUS
approved