Attn: Paul Barry - an error in the formula for the A006190 sequence

25 views
Skip to first unread message

Aleksey Yakovlev

unread,
May 10, 2026, 4:39:15 PM (4 days ago) May 10
to SeqFan
Hi, Paul and everyone,

I've noticed that a formula by Paul Barry at the A006190 page (please see below) contains an error:

`a(n) = Sum_{k=0..n-1} binomial(n-k-1,k)*3^(n-2*k-1). - Paul Barry, Oct 02 2004`

The series terms are correct but the upper bound should be `floor((n-1)/2)`.

Actually almost the same (and correct) formula exists later in the page:

`a(n+1) = Sum_{k=0..floor(n/2)} C(n-k,k)*3^(n-2*k).`

So, my suggestion is just to remove the line with the error.

Best regards,
Aleksey

Gareth McCaughan

unread,
May 10, 2026, 4:48:22 PM (4 days ago) May 10
to seq...@googlegroups.com

This seems fairly benign, in that when k > floor((n-1)/2) the binomial coefficient is zero. You could even say that the sum is over all integer k and, again, the extra terms would all be zero. (IIRC, in the book "Concrete Mathematics" by Graham, Knuth & Patashnik the authors argue quite convincingly that writing expressions containing summations in such a way that all the sums are just over all the integers -- you might then need to introduce some explicit factors of "1 if ..., else 0" -- is usually cleanest. If it's not there it's some other thing by Knuth.)

-- 
g

Aleksey Yakovlev

unread,
May 10, 2026, 6:44:56 PM (4 days ago) May 10
to SeqFan
Thanks, Gareth. I didn't think about this feature.

What about another formula on the A006190 page:

  `a(n) = Sum_{k=0..n} C(k,n-k)*3^(2*k-n). (End)`

Negative powers... Is it also a feature?

All the best,
Aleksey

Gareth McCaughan

unread,
May 11, 2026, 8:28:37 AM (3 days ago) May 11
to seq...@googlegroups.com
On 10/05/2026 23:33, Aleksey Yakovlev wrote:
> Thanks, Gareth. I didn't think about this feature.
>
> What about another formula on the A006190 page:
>
>   `a(n) = Sum_{k=0..n} C(k,n-k)*3^(2*k-n). (End)`
>
> Negative powers... Is it also a feature?

Well, it's still true that the "extra" binomial coefficients are zero
(and the other factor doesn't become infinite or anything like that).
So, still benign.

(I do tend to think that _either_ the sum should be left implicitly over
all integers, _or_ it should be explicit and over the "most natural"
range of values, which in which case would be those for which ceil(n/2)
<= k <= n. But it's definitely not _wrong_ as it's curently written. And
of course no one else is obliged to agree with me on this question of
style.)

--
g

Reply all
Reply to author
Forward
0 new messages