OFFSET

1,2

COMMENTS

Sum_{k=1..n} a(k) = A160825(n).

Consider the related sequence {b(k)}, where b(1) = 1, b(n) = the smallest positive integer such that both b(n) and Sum_{k=1..n} b(k) have the same number of 1's when they are represented in binary. Then b(1) = 1, and b(n) = 2^(n-2), for all n >= 2. (b(n) = A011782(n-1).)

LINKS

G. C. Greubel, Table of n, a(n) for n = 1..1000

Index entries for linear recurrences with constant coefficients, signature (0, 2).

FORMULA

a(2n) = 2^(n-1) and a(2n-1) = 9*2^(n-3) for n >= 3 (cf. formula for A160825). - Hagen von Eitzen, Jun 01 2009

G.f.: (-8*x^5 + 7*x^4 - 4*x^3 - x^2 + 5*x + 1)/(-2*x^2 + 1). - Alexander R. Povolotsky, Jun 08 2009

MATHEMATICA

CoefficientList[Series[(-8*x^5 + 7*x^4 - 4*x^3 - x^2 + 5*x + 1)/(-2*x^2 + 1), {x, 0, 50}], x] (* G. C. Greubel, Feb 22 2017 *)

PROG

(PARI) x='x + O('x^50); Vec((-8*x^5 + 7*x^4 - 4*x^3 - x^2 + 5*x + 1)/(-2*x^2 + 1)) \\ G. C. Greubel, Feb 22 2017

CROSSREFS

KEYWORD

nonn,base

AUTHOR

Leroy Quet, May 27 2009

EXTENSIONS

Extended by Ray Chandler, Jun 15 2009

Edited by N. J. A. Sloane, Jul 31 2009 at the suggestion of R. J. Mathar

STATUS

approved