login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A066411 Form a triangle with the numbers [0..n] on the base, where each number is the sum of the two below; a(n) = number of different possible values for the apex. 7
1, 1, 3, 5, 23, 61, 143, 215, 995, 2481, 5785, 12907, 29279, 64963, 144289, 158049, 683311, 1471123, 3166531, 6759177, 14404547, 30548713 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

COMMENTS

a(n) = number of different possible sums of c_k * (n choose k) where the c_k are a permutation of 0 through n. - Joshua Zucker, May 08 2006

LINKS

Table of n, a(n) for n=0..21.

EXAMPLE

For n = 2 we have three triangles:

..4.......5.......3

.1,3.....2,3.....2,1

0,1,2...0,2,1...2,0,1

with three different values for the apex, so a(2) = 3.

MATHEMATICA

g[s_List] := Plus @@@ Partition[s, 2, 1]; f[n_] := Block[{k = 1, lmt = 1 + (n + 1)!, lst = {}, p = Permutations[Range[0, n]]}, While[k < lmt, AppendTo[ lst, Nest[g, p[[k]], n][[1]]]; k++]; lst]; Table[ Length@ Union@ f@ n, {n, 0, 10}] (* Robert G. Wilson v, Jan 24 2012 *)

PROG

(MATLAB)

for n=0:9

size(unique(perms(0:n)*diag(fliplr(pascal(n+1)))), 1)

end % Nathaniel Johnston, Apr 20 2011

(C++)

#include <iostream>

#include <vector>

#include <set>

#include <algorithm>

using namespace std;

inline long long pascApx(const vector<int> & s)

{

    const int n = s.size() ;

    vector<long long> scp(n) ;

    for(int i=0; i<n; i++)

        scp[i] = s[i] ;

    for(int i=1; i<n; i++)

        for(int acc=0 ; acc < n-i ; acc++)

            scp[acc] += scp[acc+1] ;

    return scp[0] ;

}

int main(int argc, char *argv[])

{

    for(int n=1 ; ; n++)

    {

        vector<int> s;

        for(int i=0; i<n; i++)

            s.push_back(i) ;

        set<long long> apx;

        do

        {

            apx.insert( pascApx(s)) ;

        } while( next_permutation(s.begin(), s.end()) ) ;

        cout << n << " " << apx.size() << endl ;

    }

    return 0 ;

} /* R. J. Mathar, Jan 24 2012 */

(PARI) A066411(n)={my(u=0, o=A189391(n), v, b=vector(n++, i, binomial(n-1, i-1))~); sum(k=1, n!\2, !bittest(u, numtoperm(n, k)*b-o) & u+=1<<(numtoperm(n, k)*b-o))}  \\ - M. F. Hasler, Jan 24 2012

(Haskell)

import Data.List (permutations, nub)

a066411 0 = 1

a066411 n = length $ nub $ map

   apex [perm | perm <- permutations [0..n], head perm < last perm] where

   apex = head . until ((== 1) . length)

                       (\xs -> (zipWith (+) xs $ tail xs))

-- Reinhard Zumkeller, Jan 24 2012

CROSSREFS

Cf. A062684, A062896, A099325, A189162, A189390, A189391.

Sequence in context: A100302 A023247 A027753 * A153410 A230080 A155778

Adjacent sequences:  A066408 A066409 A066410 * A066412 A066413 A066414

KEYWORD

nice,more,nonn

AUTHOR

Naohiro Nomoto, Dec 25 2001

EXTENSIONS

More terms from John W. Layman, Jan 07 2003

a(10) from Nathaniel Johnston, Apr 20 2011

a(11) from Alois P. Heinz, Apr 21 2011

a(12) and a(13) from Joerg Arndt, Apr 21 2011

a(14)-a(15) from Alois P. Heinz, Apr 27 2011

a(0)-a(15) verified by R. H. Hardin Jan 27 2012

a(16) from Alois P. Heinz, Jan 28 2012

a(17)-a(21) from Graeme McRae, Jan 28, Feb 01 2012

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified March 24 02:10 EDT 2017. Contains 283984 sequences.