|
| |
|
|
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; 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 (joshua.zucker(AT)stanfordalumni.org), May 08 2006
The ratio of successive terms, a(n)/a(n-1), is quite irregular: 1., 3., 1.67, 4.60, 2.65, 2.34, 1.50, 4.63, 2.49, 2.33, 2.23, 2.27, 2.22, 2.22, 1.10, ... - Alois Heinz, Jan 24 2012.
|
|
|
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 A155778 A178068
Adjacent sequences: A066408 A066409 A066410 * A066412 A066413 A066414
|
|
|
KEYWORD
| nice,more,nonn,changed
|
|
|
AUTHOR
| Naohiro Nomoto (n_nomoto(AT)yabumi.com), Dec 25 2001
|
|
|
EXTENSIONS
| More terms from John W. Layman (layman(AT)math.vt.edu), Jan 07 2003
a(10) from Nathaniel Johnston (nathaniel(AT)nathanieljohnston.com), Apr 20 2011
a(11) from Alois P. Heinz (heinz(AT)hs-heilbronn.de), Apr 21 2011
a(12) and a(13) from Joerg Arndt, Apr 21 2011
a(14)-a(15) from Alois P. Heinz (heinz(AT)hs-heilbronn.de), Apr 27 2011
a(0)-a(15) verified by R. H. Hardin (rhhardin(AT)att.net) Jan 27 2012
a(16) from Alois P. Heinz (heinz(AT)hs-heilbronn.de), Jan 28 2012
a(17)-a(21) from Graeme McRae (g_m(AT)mcraefamily.com), Jan 28, Feb 01 2012
|
| |
|
|