login
A132174
Index of starting position of n-th generation of terms in A063882.
2
1, 5, 10, 21, 44, 92, 189, 385, 778, 1565, 3141, 6294, 12602, 25219, 50454, 100926, 201871, 403763, 807548, 1615119, 3230263, 6460552, 12921132, 25842293, 51684616, 103369264, 206738561, 413477157, 826954350, 1653908737, 3307817513, 6615635066, 13231270174
OFFSET
1,2
LINKS
B. Balamohan, A. Kuznetsov and S. Tanny, On the behavior of a variant of Hofstadter's Q-sequence, J. Integer Sequences, Vol. 10 (2007), #07.7.1.
FORMULA
From Chai Wah Wu, May 17 2017: (Start)
a(n) = 3*a(n-1) - 2*a(n-2) + a(n-5) - 3*a(n-6) + 2*a(n-7) for n > 8.
G.f.: x*(-5*x^7 + x^6 - x^5 - x^4 - x^3 + 3*x^2 - 2*x - 1)/((x - 1)^2*(2*x - 1)*(x^4 + x^3 + x^2 + x + 1)). (End)
PROG
(Python)
from __future__ import division
def A132174(n):
if n == 1:
return 1
if n == 2:
return 5
h, m = divmod(n - 3, 5)
return (382*2**(5*h + m)-10*2**m)//31- 7*h - m -(1 if m==3 else (-1 if m==4 else 2)) # Chai Wah Wu, May 17 2017
CROSSREFS
Sequence in context: A280077 A372054 A295952 * A297301 A132461 A255150
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Nov 07 2007
EXTENSIONS
More terms from Chai Wah Wu, May 17 2017
STATUS
approved