|
|
A060714
|
|
a(n) = a(n-1) + a(n-1 minus the number of terms of the same parity as n so far).
|
|
0
|
|
|
1, 2, 3, 5, 6, 9, 11, 17, 19, 30, 33, 50, 55, 74, 80, 99, 108, 138, 155, 188, 207, 257, 276, 331, 361, 441, 471, 579, 609, 764, 797, 985, 1018, 1225, 1275, 1551, 1601, 1962, 2017, 2458, 2532, 2973, 3053, 3632, 3731, 4340, 4448, 5057, 5195, 5992
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
EXAMPLE
|
a(5) = a(4) + a(4 - the number of odd terms so far) = a(4) + a(4-3) = 5 + 1 = 6.
|
|
MATHEMATICA
|
a[ 1 ] = 1; a[ 2 ] = 2; a[ n_ ] := a[ n ] = Block[ {e = 0}, Do[ If[ EvenQ[ a[ k ] ], e++ ], {k, 1, n - 1} ]; If[ EvenQ[ n ], a[ n - 1 ] + a[ n - 1 - e ], a[ n - 1 ] + a[ e ] ] ]; Table[ a[ n ], {n, 1, 15} ]
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|