cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A245196 Write n>=1 as either n=2^k-2^r with 0 <= r <= k-1, in which case a(2^k-2^r)=wt(k-r-1), or as n=2^k-2^r+j with 2 <= r <= k-1, 1 <= j < 2^r-1, in which case a(2^k-2^r+j)=a(j)*wt(k-r-1) (where wt(i) = A000120(i)).

This page as a plain text file.
%I A245196 #41 Jul 27 2014 12:24:22
%S A245196 0,0,1,0,0,1,1,0,0,0,0,1,0,1,2,0,0,0,0,0,0,0,0,1,0,0,1,1,0,2,1,0,0,0,
%T A245196 0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,1,1,0,0,1,2,0,1,2,0,0,0,0,0,
%U A245196 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0
%N A245196 Write n>=1 as either n=2^k-2^r with 0 <= r <= k-1, in which case a(2^k-2^r)=wt(k-r-1), or as n=2^k-2^r+j with 2 <= r <= k-1, 1 <= j < 2^r-1, in which case  a(2^k-2^r+j)=a(j)*wt(k-r-1) (where wt(i) = A000120(i)).
%C A245196 Other sequences defined by a recurrence of this class (see the Formula and Maple sections) include A245180, A245195, A048896, A245536, A038374.
%F A245196 This is an example of a class of sequences defined by the following recurrence.
%F A245196 We first choose a sequence G = [G(0), G(1), G(2), G(3), ...], which are the terms that will appear at the ends of the blocks: a(2^k-1) = G(k-1), and we also choose a parameter m (the "multiplier"). Then the recurrence (this defines a(1), a(2), a(3), ...) is:
%F A245196 a(2^k-2^r)=G(k-r-1) if 0 <= r <= k-1, a(2^k-2^r+j)=m*a(j)*G(k-r-1) if 2 <= r <= k-1, 1 <= j < 2^r-1.
%F A245196 To help apply the recurrence, here are the values of k,r,j for the first few values of n (if n=2^k-2^r we set j=0, although it is not used):
%F A245196 n:  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
%F A245196 k:  1  2  2  3  3  3  3  4  4  4  4  4  4  4  4
%F A245196 r:  0  1  0  2  2  1  0  3  3  3  3  2  2  1  0
%F A245196 j:  0  0  0  0  1  0  0  0  1  2  3  0  1  0  0
%F A245196 --------------------------------------------------
%F A245196 n: 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
%F A245196 k:  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5  5
%F A245196 r:  4  4  4  4  4  4  4  4  3  3  3  3  2  2  1  0
%F A245196 j:  0  1  2  3  4  5  6  7  0  1  2  3  0  1  0  0
%F A245196 --------------------------------------------------
%F A245196 In the present example G(n) = wt(n) and m=1.
%e A245196 May be arranged into blocks of lengths 1,2,4,8,...:
%e A245196 0,
%e A245196 0, 1,
%e A245196 0, 0, 1, 1,
%e A245196 0, 0, 0, 0, 1, 0, 1, 2,
%e A245196 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 2, 1,
%e A245196 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 2, 0, 1, 2,
%e A245196 ...
%p A245196 Maple code for this sequence:
%p A245196 wt := proc(n) local w, m, i; w := 0; m := n; while m > 0 do i := m mod 2; w := w+i; m := (m-i)/2; od; w; end:
%p A245196 G:=[seq(wt(n),n=0..30)];
%p A245196 m:=1;
%p A245196 f:=proc(n) option remember; global m,G; local k,r,j,np;
%p A245196    k:=1+floor(log[2](n)); np:=2^k-n;
%p A245196    if np=1 then r:=0; j:=0; else r:=1+floor(log[2](np-1)); j:=2^r-np; fi;
%p A245196    if j=0 then G[k-r]; else m*G[k-r]*f(j); fi;
%p A245196 end;
%p A245196 [seq(f(n),n=1..120)];
%p A245196 # Maple code for the general recurrence:
%p A245196 G:=[seq(wt(n),n=0..30)]; # replace this by a list G=[G(0), G(1), G(2), ...], remembering that you have to tell Maple G[1] to get G(0), G[2] to get G(1), etc.
%p A245196 m:=1; # replace this by the correct multiplier
%p A245196 f:=proc(n) option remember; global m,G; local k,r,j,np;
%p A245196    k:=1+floor(log[2](n)); np:=2^k-n;
%p A245196    if np=1 then r:=0; j:=0; else r:=1+floor(log[2](np-1)); j:=2^r-np; fi;
%p A245196    if j=0 then G[k-r-1+1]; else m*G[k-r-1+1]*f(j); fi;
%p A245196 end;
%p A245196 [seq(f(n),n=1..120)];
%p A245196 # If G(n) = wt(n) and m=1 we get the present sequence
%p A245196 # If G(n) = A083424(n) and m=1 we get A245537
%p A245196 # If G(n) = A083424(n) and m=2 we get A245538
%p A245196 # If G(n) = A083424(n) and m=4 we get A245539
%p A245196 # If G(n) = A083424(n) and m=8 we get A245180 (and presumably A160239)
%p A245196 # If G(n) = n (n>=0) and m=1 we get A245536
%p A245196 # If G(n) = n+1 (n>=0) and m=1 we get A038374
%p A245196 # If G(n) = (n+1)(n+2)/2 (n>=0) and m=1 we get A245541
%p A245196 # If G(n) = (n+1)(n+2)/2 (n>=0) and m=2 we get A245547
%p A245196 # If G(n) = 2^n (n>=0) and m=1 we get A245195 (= 2^A014081)
%p A245196 # If G(n) = 2^n (n>=0) and m=2 we get A048896
%Y A245196 Cf. A000120, A160239, A245180, A245195, A014081, A048896, A038374, A245536, A245537, A245538, A245539, A048896, A245547.
%K A245196 nonn,tabf
%O A245196 1,15
%A A245196 _N. J. A. Sloane_, Jul 25 2014