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.

A151787 a(1)=1; for n > 1, a(n)=3*2^{wt(n-1)-1}.

This page as a plain text file.
%I A151787 #23 Jun 23 2021 05:08:01
%S A151787 1,3,3,6,3,6,6,12,3,6,6,12,6,12,12,24,3,6,6,12,6,12,12,24,6,12,12,24,
%T A151787 12,24,24,48,3,6,6,12,6,12,12,24,6,12,12,24,12,24,24,48,6,12,12,24,12,
%U A151787 24,24,48,12,24,24,48,24,48,48,96,3,6,6,12,6,12,12,24,6,12,12,24,12,24,24,48
%N A151787 a(1)=1; for n > 1, a(n)=3*2^{wt(n-1)-1}.
%C A151787 wt(n) is the Hamming weight = binary weight of n (A000120).
%H A151787 Robert Israel, <a href="/A151787/b151787.txt">Table of n, a(n) for n = 1..10000</a>
%F A151787 From _Robert Israel_, Feb 27 2018: (Start)
%F A151787 For n > 1, a(2*n)=2*a(n).
%F A151787 a(2*n+1)=a(n+1).
%F A151787 G.f. g(x) satisfies g(x) = (2+1/x)*g(x^2) + x^2. (End)
%F A151787 a(n) = 3*A001316(n-1)/2 for n >= 2. - _Georg Fischer_, Jun 23 2021
%p A151787 wt:= n -> convert(convert(n,base,2),`+`):
%p A151787 [1, seq(3*2^(wt(n-1)-1),n=2..100)]; # _Robert Israel_, Feb 27 2018
%t A151787 a[n_] := If[n == 1, 1, 3*2^(Total[IntegerDigits[n-1, 2]]-1)];
%t A151787 Array[a, 100] (* _Jean-François Alcover_, Mar 27 2019 *)
%o A151787 (PARI) a(n) = if (n==1, 1, 3*2^(hammingweight(n-1)-1)); \\ _Michel Marcus_, Feb 27 2018
%Y A151787 Cf. A000120, A001316, A147582, A151779.
%K A151787 nonn
%O A151787 1,2
%A A151787 _N. J. A. Sloane_, Jun 25 2009
%E A151787 Definition corrected by _Omar E. Pol_, Mar 03 2015