A120738 a(n) = 4*n - A000120(n).
0, 3, 7, 10, 15, 18, 22, 25, 31, 34, 38, 41, 46, 49, 53, 56, 63, 66, 70, 73, 78, 81, 85, 88, 94, 97, 101, 104, 109, 112, 116, 119, 127, 130, 134, 137, 142, 145, 149, 152, 158, 161, 165, 168, 173, 176, 180, 183, 190, 193, 197, 200, 205, 208, 212, 215, 221, 224, 228
Offset: 0
Links
- Michel Marcus, Table of n, a(n) for n = 0..10000
- Keith Johnson, and Kira Scheibelhut, Rational Polynomials That Take Integer Values at the Fibonacci Numbers, American Mathematical Monthly 123.4 (2016): 338-346. See p. 340.
Crossrefs
Programs
-
Magma
A120738:= func< n | 4*n-(&+Intseq(n, 2)) >; [A120738(n): n in [0..100]]; // G. C. Greubel, Oct 20 2024
-
Maple
a:=n->simplify(log[2](16^n/(add(modp(binomial(n,k),2),k=0..n)))); 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
-
Mathematica
Table[4 n - DigitCount[n, 2, 1], {n, 0, 58}] (* Michael De Vlieger, Nov 06 2016 *)
-
PARI
{a(n) = if( n < 0, 0, 4*n - subst( Pol( binary( n ) ), x, 1) ) } /* Michael Somos, Aug 28 2007 */
-
PARI
a(n) = 4*n - hammingweight(n); \\ Michel Marcus, Nov 06 2016
-
Python
# Python 3.10 def A120738(n): return (n<<2)-n.bit_count() # Chai Wah Wu, Jul 12 2022
-
Sage
A120738 = lambda n: 4*n - sum(n.digits(2)) print([A120738(n) for n in (0..58)]) # Peter Luschny, Nov 06 2016
Formula
Extensions
Definition simplified by M. F. Hasler, Dec 29 2012
Comments