login
a(n) = 4*n - A000120(n).
10

%I #57 Oct 20 2024 12:47:18

%S 0,3,7,10,15,18,22,25,31,34,38,41,46,49,53,56,63,66,70,73,78,81,85,88,

%T 94,97,101,104,109,112,116,119,127,130,134,137,142,145,149,152,158,

%U 161,165,168,173,176,180,183,190,193,197,200,205,208,212,215,221,224,228

%N a(n) = 4*n - A000120(n).

%C Partial sums of A090739.

%C a(n) is also the increasing sequence of exponents of x in Product_{k > 1} (1 + x^(2^k - 1)). - Paul Pearson (ppearson(AT)rochester.edu), Aug 06 2008

%C Related to partial sums of the Ruler sequence A001511 by a(n) = A005187(2n), therefore {a(n)+1} are the indices of 1's in A252488. - _M. F. Hasler_, Jan 22 2015

%H Michel Marcus, <a href="/A120738/b120738.txt">Table of n, a(n) for n = 0..10000</a>

%H Keith Johnson, and Kira Scheibelhut, <a href="http://www.jstor.org/stable/10.4169/amer.math.monthly.123.4.338">Rational Polynomials That Take Integer Values at the Fibonacci Numbers</a>, American Mathematical Monthly 123.4 (2016): 338-346. See p. 340.

%F a(n) = log_2(16^n/A001316(n)). [This was the original definition.]

%F a(n) = 2n + A005187(n).

%F a(n) = 3n + A011371(n).

%F a(n) = 4n - log_2(A001316(n)).

%F a(n) = log_2(A061549(n)).

%F 2^a(n) = 16^n/A001316(n) = A061549(n).

%F a(n) = A086343(n) + A001511(n) for n>0. - _Alford Arnold_, Mar 23 2009

%F 2^a(n) = abs(A067624(n)/A117972(n)). - _Johannes W. Meijer_, Jul 06 2009

%F a(n) = Sum_{k>=0} (A030308(n,k)*A000225(k+2)). - _Philippe Deléham_, Oct 16 2011

%F a(n) = A005187(2n). - _M. F. Hasler_, Jan 22 2015

%p a:=n->simplify(log[2](16^n/(add(modp(binomial(n,k),2),k=0..n))));

%p a:=n->simplify(log[2](16^n/(2^(n-(padic[ordp](n!,2)))))); # Note: n-(padic[ordp](n!,2)) is the number of 1's in the binary expansion of n. - Paul Pearson (ppearson(AT)rochester.edu), Aug 06 2008

%t Table[4 n - DigitCount[n, 2, 1], {n, 0, 58}] (* _Michael De Vlieger_, Nov 06 2016 *)

%o (PARI) {a(n) = if( n < 0, 0, 4*n - subst( Pol( binary( n ) ), x, 1) ) } /* _Michael Somos_, Aug 28 2007 */

%o (PARI) a(n) = 4*n - hammingweight(n); \\ _Michel Marcus_, Nov 06 2016

%o (Sage)

%o A120738 = lambda n: 4*n - sum(n.digits(2))

%o print([A120738(n) for n in (0..58)]) # _Peter Luschny_, Nov 06 2016

%o (Python 3.10+)

%o def A120738(n): return (n<<2)-n.bit_count() # _Chai Wah Wu_, Jul 12 2022

%o (Magma)

%o A120738:= func< n | 4*n-(&+Intseq(n, 2)) >;

%o [A120738(n): n in [0..100]]; // _G. C. Greubel_, Oct 20 2024

%Y Cf. A000120, A000225, A001316, A001511, A005187, A011371, A030308, A061549, A067624, A086343, A090739, A117972, A252488.

%K easy,nonn,changed

%O 0,2

%A _Paul Barry_, Jun 29 2006

%E Definition simplified by _M. F. Hasler_, Dec 29 2012