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.

A151902 a(n) = wt(k) + f(j) if n = 6k+j, 0 <= j < 6, where wt() = A000120(), f() = A151899().

This page as a plain text file.
%I A151902 #5 Feb 16 2023 05:12:27
%S A151902 0,0,1,1,1,2,1,1,2,2,2,3,1,1,2,2,2,3,2,2,3,3,3,4,1,1,2,2,2,3,2,2,3,3,
%T A151902 3,4,2,2,3,3,3,4,3,3,4,4,4,5,1,1,2,2,2,3,2,2,3,3,3,4,2,2,3,3,3,4,3,3,
%U A151902 4,4,4,5,2,2,3,3,3,4,3,3,4,4,4,5,3,3,4,4,4,5,4,4,5,5,5,6,1,1,2,2,2,3,2,2,3
%N A151902 a(n) = wt(k) + f(j) if n = 6k+j, 0 <= j < 6, where wt() = A000120(), f() = A151899().
%p A151902 f := proc(n) local j; j:=n mod 6; if (j<=1) then 0 elif (j<=4) then 1 else 2; fi; end;
%p A151902 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 A151902 A151902 := proc(n) local k,j; k:=floor(n/6); j:=n-6*k; wt(k)+f(j); end;
%t A151902 wt[n_] := DigitCount[n, 2, 1];
%t A151902 f[n_] := {0, 0, 1, 1, 1, 2}[[Mod[n, 6] + 1]];
%t A151902 a[n_] := wt[Floor[n/6]] + f[n - 6 Floor[n/6]];
%t A151902 Table[a[n], {n, 0, 104}] (* _Jean-François Alcover_, Feb 16 2023 *)
%Y A151902 Cf. A000120, A151899, A151904-A151907.
%K A151902 nonn
%O A151902 0,6
%A A151902 _N. J. A. Sloane_, Jul 31 2009