# [seqfan] Re: Triangles of sums

Nacin, David NACIND at wpunj.edu
Fri Jul 23 17:01:53 CEST 2021

```This was helpful!  You're counting all the non-extendable pyramids - pyramids for which it is not possible to add a row below? You're also counting up to reflective symmetry, counting a pyramid and its reflection only once?  You get a(8) = 3 and a(9) = 5 because you are only counting the blue triangles in the two attached pictures since those are the non-extendable ones up to symmetry.

The way I see it then, there are six sequences of number of pyramids here.

There are the non-extendable ones which you've been counting.  There are the max-height pyramids which only count ones that achieve the maximum height for that n.  There are the any-height pyramids which include pyramids of all heights like I was counting in my previous e-mail.  Then for each of those three you also have the two cases of counting up to reflections or counting all the pyramids.

I have code that goes pretty far for four of these, tackling the two max-height and two any-height cases.  I could quickly modify it to do the other two cases as well.  My code can go out to the first hundred terms or so, but then gets slow, though I could probably speed it up given some time.  Also, I'm sure someone else could write something faster if they desired.

-David

-----Original Message-----
From: SeqFan <seqfan-bounces at list.seqfan.eu> On Behalf Of jnthn stdhr
Sent: Friday, July 23, 2021 10:38 AM
To: Sequence Fanatics Discussion list <seqfan at list.seqfan.eu>
Subject: [seqfan] Re: Triangles of sums

Maybe this will help...

For each element in a triangle, consider all partitions of that element that have exactly two parts (possible children).  For n=2, place 2 at the apex to form a one-row triangle:

2

2
1 1

This is not valid and we have no more partitions to try, so a(2) = 1

But if all children can have distinct children then we have a new and complete row and the triangle(s) of lesser height are "incomplete."

Let's look at possible triangles for a(9), which include the first
*successful* use of backtracking:

9          9                     9
9      9      9        6 3       6 3       9        5 4
9    8 1   7 2   6 3    5 1 2    4 2 1    5 4     2 3 1

Because we *can* have more than one row the first triangle is dropped.
The next two are valid and have no possible children, so we count them.
The fourth one is dropped because the next two utilize backtracking to find solutions with *more* than two rows.  The seventh one is dropped because we find one solution with more than two rows.  So we end up with a(9) = 5:

9          9          9
9      9      6 3       6 3       5 4
8 1   7 2   5 1 2    4 2 1    2 3 1

Hope this helps.

-jnthn

On Fri, Jul 23, 2021, 6:26 AM jnthn stdhr <jstdhr at gmail.com> wrote:

>
>
> On Fri, Jul 23, 2021, 6:13 AM Allan Wechsler <acwacw at gmail.com> wrote:
>
>> Okay, that list helps me focus on my area of confusion. Why do you
>> exclude a singleton 3? You allow a singleton 2. What is the rule?
>>
>> On Fri, Jul 23, 2021, 5:40 AM jnthn stdhr <jstdhr at gmail.com> wrote:
>>
>> > Hi, Allan.
>> >
>> > To clarify, 1 and 2 have no possible distinct children, hence they
>> > have height of 1.  And you are correct, I am not counting
>> > reflections, since
>> > A340389 does not.
>> >
>> > The first few triangles are:
>> >
>> >             3      4      5      5
>> > 1,  2,  1 2,  1 3,  1 4,  2 3
>> >
>> > As for the typo, In my notebook see I have the 10, 64, 513 triangle
>> > just below the 8, 53, 412 triangle, so I think my error is a result
>> > of
>> looking
>> > at the wrong line and not seeing the obvious error 6+4!=8. Sorry
>> > for the confusion.
>> >
>> > -jnthn
>> >
>> >
>> > On Thursday, July 22, 2021, Allan Wechsler <acwacw at gmail.com> wrote:
>> >
>> > > I applaud your instinct to make sure that simple cases accompany
>> > > their
>> > more
>> > > complicated brethren into the Encyclopedia -- I think this is
>> > > right on target.
>> > >
>> > > But I am missing something here. Can you display all the
>> > > triangles for
>> > n=1
>> > > to 3? My problem is that you must be allowing triangles of one
>> > > row in
>> > order
>> > > to have one example for n=1 and n=2, but then it seems to me that
>> > > you
>> > ought
>> > > to have two examples for n=3, one with one row, and one with two rows.
>> > But
>> > > you say there is only one.
>> > >
>> > > Also, I am assuming you do *not* consider reflections around the
>> vertical
>> > > axis to be distinct solutions.
>> > >
>> > > I'm sure some sequence fanatic will be happy to help you as soon
>> > > as
>> it's
>> > > clearer what your definitions are.
>> > >
>> > > One last thing: 6 + 4 does not equal 8, as your second example
>> > > seems
>> to
>> > > claim.
>> > >
>> > > On Thu, Jul 22, 2021 at 5:06 PM jnthn stdhr <jstdhr at gmail.com> wrote:
>> > >
>> > > > Hello seqfans.
>> > > >
>> > > > Long time no sequence (apologies.)  Inspired by ,
>> > > oeis.org%2FA340389&data=04%7C01%7Cnacind%40wpunj.edu%7Ccd7414
>> > > 6129354ac9e98208d94de86038%7C74540637643546cc87a46d38efb78538%7C0
>> > > %7C0%7C637626482721186717%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjA
>> > > wMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sd
>> > > ata=ePIZykhmOcd90B%2F7rnjR7ekcPjf43DWjCvI%2FuIKjZ7c%3D&reserv
>> > > ed=0
>> > > > wondered if a generalized sequence, the number of sum triangles
>> > > > of
>> n,
>> > > was
>> > > > in the database -- it appears it is not.
>> > > >
>> > > > If we define a sum triangle of n as a triangle with n at its
>> > > > apex,
>> all
>> > > > pair-wise members (x, y) of rows 2,3,4,... sum to the element
>> > immediately
>> > > > above, every element is distinct, and rows are complete (length
>> > > > of
>> row
>> > m
>> > > =
>> > > > length of row (m-1) + 1.
>> > > >
>> > > > For example:
>> > > >
>> > > >           8         9        9
>> > > >  3      6 4      6 3     6 3
>> > > > 2 1   5 1 3   5 1 2  4 2 1
>> > > >
>> > > >
>> > > > The sequence I get for n=1 to 30 is:
>> > > >
>> > > >
>> > > > [1, 1, 1, 1, 2, 2, 3, 3, 5, 5, 7, 9, 11, 11, 18, 17, 22, 23,
>> > > > 29, 31,
>> > 38,
>> > > > 37, 46, 49, 58, 59, 72, 76, 86, 90]
>> > > >
>> > > > My python code is about 70 lines long.  Maybe a MMA expert
>> > > > could
>> write
>> > a
>> > > > more concise program and confirm the the sequence?
>> > > >
>> > > > -Jonathan
>> > > >
>> > > > --
>> > > > Seqfan Mailing list -
>> > > > 2Flist.seqfan.eu%2F&data=04%7C01%7Cnacind%40wpunj.edu%7Ccd7
>> > > > 4146129354ac9e98208d94de86038%7C74540637643546cc87a46d38efb7853
>> > > > 8%7C0%7C0%7C637626482721186717%7CUnknown%7CTWFpbGZsb3d8eyJWIjoi
>> > > > MC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C10
>> > > > 00&sdata=TwwVPb0xDEy2RL9bVeAMpypyVh7KyR2kBwnZX1oHp%2FY%3D&a
>> > > > mp;reserved=0
>> > > >
>> > >
>> > > --
>> > > Seqfan Mailing list -
>> > > list.seqfan.eu%2F&data=04%7C01%7Cnacind%40wpunj.edu%7Ccd74146
>> > > 129354ac9e98208d94de86038%7C74540637643546cc87a46d38efb78538%7C0%
>> > > 7C0%7C637626482721196672%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAw
>> > > MDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sda
>> > > ta=89RcRJ2n4aLZ3TEeq1HGQqoN434B4pq0D4gK%2F2NqGew%3D&reserved=
>> > > 0
>> > >
>> >
>> > --
>> > Seqfan Mailing list -
>> > st.seqfan.eu%2F&data=04%7C01%7Cnacind%40wpunj.edu%7Ccd741461293
>> > 54ac9e98208d94de86038%7C74540637643546cc87a46d38efb78538%7C0%7C0%7C
>> > 637626482721196672%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQ
>> > IjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=89RcRJ2
>> > n4aLZ3TEeq1HGQqoN434B4pq0D4gK%2F2NqGew%3D&reserved=0
>> >
>>
>> --
>> Seqfan Mailing list -
>> .seqfan.eu%2F&data=04%7C01%7Cnacind%40wpunj.edu%7Ccd74146129354ac
>> 9e98208d94de86038%7C74540637643546cc87a46d38efb78538%7C0%7C0%7C637626
>> 482721196672%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2lu
>> MzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=89RcRJ2n4aLZ3TEeq
>> 1HGQqoN434B4pq0D4gK%2F2NqGew%3D&reserved=0
>>
>

--