|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
FORMULA
|
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
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
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|