cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Previous Showing 31-40 of 61 results. Next

A267667 T(n,k)=Number of nXk 0..1 arrays with every repeated value in every row unequal to the previous repeated value, and in every column equal to the previous repeated value, and new values introduced in row-major sequential order.

Original entry on oeis.org

1, 2, 2, 3, 8, 4, 5, 18, 32, 7, 7, 50, 108, 98, 12, 11, 98, 500, 453, 288, 20, 15, 242, 1372, 3143, 1800, 800, 33, 23, 450, 5324, 10933, 18432, 6654, 2178, 54, 31, 1058, 13500, 60401, 80404, 98438, 23967, 5832, 88, 47, 1922, 48668, 188301, 624476, 528980
Offset: 1

Views

Author

R. H. Hardin, Jan 19 2016

Keywords

Comments

Table starts
...1.....2.......3........5.........7..........11...........15............23
...2.....8......18.......50........98.........242..........450..........1058
...4....32.....108......500......1372........5324........13500.........48668
...7....98.....453.....3143.....10933.......60401.......188301........951113
..12...288....1800....18432.....80404......624476......2369260......16599404
..20...800....6654....98438....528980.....5663798.....25652956.....245171384
..33..2178...23967...508681...3351233....49212395....264709135....3440837625
..54..5832...84552..2560344..20607770...413258400...2629810220...46354321490
..88.15488..295176.12721832.124968034..3417993766..25695609592..614111962042
.143.40898.1023321.62688891.751679881.28026084373.248940754959.8066250323665

Examples

			Some solutions for n=5 k=4
..0..1..0..1....0..1..1..0....0..0..1..0....0..1..0..1....0..1..1..0
..0..0..1..1....0..0..1..1....1..0..1..1....1..1..0..0....0..0..1..1
..1..1..0..0....0..0..1..1....0..1..1..0....0..0..1..1....1..0..1..0
..0..1..0..1....1..0..0..1....1..0..0..1....0..1..0..0....0..0..1..0
..0..1..0..1....0..0..1..1....1..0..1..0....0..0..1..1....0..1..0..1
		

Crossrefs

Column 1 is A000071(n+2).
Row 1 is A052955(n-1).
Row 2 is A267638.

Formula

Empirical for column k:
k=1: a(n) = 2*a(n-1) -a(n-3)
k=2: a(n) = 4*a(n-1) -2*a(n-2) -6*a(n-3) +4*a(n-4) +2*a(n-5) -a(n-6)
k=3: [order 16]
k=4: [order 80]
Empirical for row n:
n=1: a(n) = a(n-1) +2*a(n-2) -2*a(n-3)
n=2: a(n) = a(n-1) +6*a(n-2) -6*a(n-3) -8*a(n-4) +8*a(n-5)
n=3: a(n) = a(n-1) +14*a(n-2) -14*a(n-3) -56*a(n-4) +56*a(n-5) +64*a(n-6) -64*a(n-7)
n=4: [order 21]
n=5: [order 96]

A274581 Number T(n,k) of set partitions of [n] with alternating parity of elements and exactly k blocks; triangle T(n,k), n>=0, 0<=k<=n, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 1, 2, 1, 0, 1, 3, 3, 1, 0, 1, 5, 7, 4, 1, 0, 1, 7, 14, 12, 5, 1, 0, 1, 11, 30, 33, 19, 6, 1, 0, 1, 15, 57, 84, 62, 27, 7, 1, 0, 1, 23, 119, 222, 204, 108, 37, 8, 1, 0, 1, 31, 224, 545, 627, 409, 169, 48, 9, 1, 0, 1, 47, 460, 1425, 2006, 1558, 763, 254, 61, 10, 1
Offset: 0

Views

Author

Alois P. Heinz, Jun 29 2016

Keywords

Examples

			T(5,1) = 1: 12345.
T(5,2) = 5: 1234|5, 123|45, 12|345, 145|23, 1|2345.
T(5,3) = 7: 123|4|5, 12|34|5, 12|3|45, 1|234|5, 145|2|3, 1|2|345, 1|23|45.
T(5,4) = 4: 12|3|4|5, 1|23|4|5, 1|2|34|5, 1|2|3|45.
T(5,5) = 1: 1|2|3|4|5.
Triangle T(n,k) begins:
  1;
  0, 1;
  0, 1,  1;
  0, 1,  2,   1;
  0, 1,  3,   3,   1;
  0, 1,  5,   7,   4,   1;
  0, 1,  7,  14,  12,   5,   1;
  0, 1, 11,  30,  33,  19,   6,   1;
  0, 1, 15,  57,  84,  62,  27,   7,  1;
  0, 1, 23, 119, 222, 204, 108,  37,  8, 1;
  0, 1, 31, 224, 545, 627, 409, 169, 48, 9, 1;
  ...
		

Crossrefs

Columns k=0-10 give: A000007, A057427, A052955(n-2) for n>1, A305777, A305778, A305779, A305780, A305781, A305782, A305783, A305784.
Diagonals include A000012, A001477, A077043.
Row sums give A274547.
T(n,ceiling(n/2)) gives A305785.
Cf. A124419, A274310 (parities alternate within blocks), A305823.

Programs

  • Maple
    b:= proc(l, i, t) option remember; `if`(l=[], x,
         `if`(l[1]=t, 0, expand(x*b(subsop(1=[][], l), 1, 1-t)
           ))+add(`if`(l[j]=t, 0, b(subsop(j=[][], l), j, 1-t)
           ), j=i..nops(l)))
        end:
    T:= n-> `if`(n=0, 1, (p-> seq(coeff(p, x, j), j=0..n))(
             b([seq(irem(i, 2), i=2..n)], 1$2))):
    seq(T(n), n=0..12);
  • Mathematica
    b[l_, i_, t_] := b[l, i, t] = If[l == {}, x, If[l[[1]] == t, 0, Expand[x*b[Rest[l], 1, 1 - t]]] + Sum[If[l[[j]] == t, 0, b[Delete[l, j], j, 1 - t]], {j, i, Length[l]}]];
    T[n_] := If[n==0, {1}, Function[p, Table[Coefficient[p, x, j], {j, 0, n}]][ b[Table[Mod[i, 2], {i, 2, n}], 1, 1]]];
    Flatten[Table[T[n], {n, 0, 12}]] (* Jean-François Alcover, May 27 2018, from Maple *)

Formula

Sum_{k=0..n} k * T(n,k) = A305823(n).

A350252 Number of non-alternating patterns of length n.

Original entry on oeis.org

0, 0, 1, 7, 53, 439, 4121, 43675, 519249, 6867463, 100228877, 1602238783, 27866817297, 524175098299, 10606844137009, 229807953097903, 5308671596791901, 130261745042452855, 3383732450013895721, 92770140175473602755, 2677110186541556215233
Offset: 0

Views

Author

Gus Wiseman, Jan 13 2022

Keywords

Comments

We define a pattern to be a finite sequence covering an initial interval of positive integers. Patterns are counted by A000670 and ranked by A333217.
A sequence is alternating if it is alternately strictly increasing and strictly decreasing, starting with either. For example, the partition (3,2,2,2,1) has no alternating permutations, even though it does have the anti-run permutations (2,3,2,1,2) and (2,1,2,3,2). An alternating pattern is necessarily an anti-run (A005649).
Conjecture: Also the number of non-weakly up/down (or down/up) patterns of length n. For example:
- The a(3) = 7 non-weakly up/down patterns:
(121), (122), (123), (132), (221), (231), (321)
- The a(3) = 7 non-weakly down/up patterns:
(112), (123), (211), (212), (213), (312), (321)
- The a(3) = 7 non-alternating patterns (see example for more):
(111), (112), (122), (123), (211), (221), (321)

Examples

			The a(2) = 1 and a(3) = 7 non-alternating patterns:
  (1,1)  (1,1,1)
         (1,1,2)
         (1,2,2)
         (1,2,3)
         (2,1,1)
         (2,2,1)
         (3,2,1)
The a(4) = 53 non-alternating patterns:
  2112   3124   4123   1112   2134   1234   3112   2113   1123
  2211   3214   4213   1211   2314   1243   3123   2123   1213
  2212   3412   4312   1212   2341   1324   3211   2213   1223
         3421   4321   1221   2413   1342   3212   2311   1231
                       1222   2431   1423   3213   2312   1232
                                     1432   3312   2313   1233
                                            3321   2321   1312
                                                   2331   1321
                                                          1322
                                                          1323
                                                          1332
		

Crossrefs

The unordered version is A122746.
The version for compositions is A345192, ranked by A345168, weak A349053.
The complement is counted by A345194, weak A349058.
The version for factorizations is A348613, complement A348610, weak A350139.
The strict case (permutations) is A348615, complement A001250.
The weak version for partitions is A349061, complement A349060.
The weak version for perms of prime indices is A349797, complement A349056.
The weak version is A350138.
The version for perms of prime indices is A350251, complement A345164.
A000670 = patterns (ranked by A333217).
A003242 = anti-run compositions, complement A261983, ranked by A333489.
A005649 = anti-run patterns, complement A069321.
A019536 = necklace patterns.
A025047/A129852/A129853 = alternating compositions, ranked by A345167.
A226316 = patterns avoiding (1,2,3), weakly A052709, complement A335515.
A345163 = normal partitions w/ alternating permutation, complement A345162.
A345170 = partitions w/ alternating permutation, complement A345165.
A349055 = normal multisets w/ alternating permutation, complement A349050.

Programs

  • Mathematica
    allnorm[n_]:=If[n<=0,{{}},Function[s,Array[Count[s,y_/;y<=#]+1&,n]]/@Subsets[Range[n-1]+1]];
    wigQ[y_]:=Or[Length[y]==0,Length[Split[y]]==Length[y]&& Length[Split[Sign[Differences[y]]]]==Length[y]-1];
    Table[Length[Select[Join@@Permutations/@allnorm[n],!wigQ[#]&]],{n,0,6}]

Formula

a(n) = A000670(n) - A345194(n).

Extensions

Terms a(9) and beyond from Andrew Howroyd, Feb 04 2022

A243571 Irregular triangular array generated as in Comments; contains every positive integer exactly once.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 7, 9, 10, 12, 16, 11, 13, 14, 17, 18, 20, 24, 32, 15, 19, 21, 22, 25, 26, 28, 33, 34, 36, 40, 48, 64, 23, 27, 29, 30, 35, 37, 38, 41, 42, 44, 49, 50, 52, 56, 65, 66, 68, 72, 80, 96, 128, 31, 39, 43, 45, 46, 51, 53, 54, 57, 58, 60, 67, 69
Offset: 1

Views

Author

Clark Kimberling, Jun 07 2014

Keywords

Comments

Decree that row 1 is (1) and row 2 is (2). For n >= 3, row n consists of numbers in increasing order generated as follows: 2*x for each x in row n-1 together with 1+2*x for each x in row n-2. It is easy to prove that row n consists of F(n) numbers, where F = A000045 (the Fibonacci numbers), and that every positive integer occurs exactly once. Row n has F(n-1) even numbers and F(n-2) odd numbers.
The least and greatest numbers in row n are A083329(n-1) and 2^(n-1), for n >= 1.

Examples

			First 6 rows of the array:
  1
  2
  3 ... 4
  5 ... 6 ... 8
  7 ... 9 ... 10 .. 12 .. 16
  11 .. 13 .. 14 .. 17 .. 18 .. 20 .. 24 .. 32
		

Crossrefs

Cf. A052955 for the first element in each row.

Programs

  • Mathematica
    z = 10; g[1] = {1}; f1[x_] := x + 1; f2[x_] := 2 x; h[1] = g[1];
    b[n_] := b[n] = DeleteDuplicates[Union[f1[g[n - 1]], f2[g[n - 1]]]];
    h[n_] := h[n] = Union[h[n - 1], g[n - 1]];
    g[n_] := g[n] = Complement [b[n], Intersection[b[n], h[n]]]
    u = Table[g[n], {n, 1, z}]; v = Flatten[u] (* A243571 *)

A350138 Number of non-weakly alternating patterns of length n.

Original entry on oeis.org

0, 0, 0, 2, 32, 338, 3560, 40058, 492664, 6647666, 98210192, 1581844994, 27642067000, 521491848218, 10572345303576, 229332715217954, 5301688511602448, 130152723055769810, 3381930236770946120, 92738693031618794378, 2676532576838728227352
Offset: 0

Views

Author

Gus Wiseman, Dec 24 2021

Keywords

Comments

We define a pattern to be a finite sequence covering an initial interval of positive integers. Patterns are counted by A000670 and ranked by A333217.
We define a sequence to be weakly alternating if it is alternately weakly increasing and weakly decreasing, starting with either.
Conjecture: The directed cases, which count non-weakly up/down or non-weakly down/up patterns, are both equal to the strong case: A350252.

Examples

			The a(4) = 32 patterns:
  (1,1,2,3)  (2,1,1,2)  (3,1,1,2)  (4,1,2,3)
  (1,2,2,1)  (2,1,1,3)  (3,1,2,3)  (4,2,1,3)
  (1,2,3,1)  (2,1,2,3)  (3,1,2,4)  (4,3,1,2)
  (1,2,3,2)  (2,1,3,4)  (3,2,1,1)  (4,3,2,1)
  (1,2,3,3)  (2,3,2,1)  (3,2,1,2)
  (1,2,3,4)  (2,3,3,1)  (3,2,1,3)
  (1,2,4,3)  (2,3,4,1)  (3,2,1,4)
  (1,3,2,1)  (2,4,3,1)  (3,3,2,1)
  (1,3,3,2)             (3,4,2,1)
  (1,3,4,2)
  (1,4,3,2)
		

Crossrefs

The unordered version is A274230, complement A052955.
The strong case of compositions is A345192, ranked by A345168.
The strict case is A348615, complement A001250.
For compositions we have A349053, complement A349052, ranked by A349057.
The complement is counted by A349058.
The version for partitions is A349061, complement A349060.
The version for permutations of prime indices: A349797, complement A349056.
The version for ordered factorizations is A350139, complement A349059.
The strong case is A350252, complement A345194. Also the directed case?
A003242 = Carlitz compositions, complement A261983, ranked by A333489.
A005649 = anti-run patterns, complement A069321.
A025047/A129852/A129853 = alternating compositions, ranked by A345167.
A345163 = normal partitions w/ alternating permutation, complement A345162.
A345170 = partitions w/ alternating permutation, complement A345165.
A349055 = normal multisets w/ alternating permutation, complement A349050.

Programs

  • Mathematica
    allnorm[n_]:=If[n<=0,{{}},Function[s,Array[Count[s,y_/;y<=#]+1&,n]]/@Subsets[Range[n-1]+1]];
    whkQ[y_]:=And@@Table[If[EvenQ[m],y[[m]]<=y[[m+1]],y[[m]]>=y[[m+1]]],{m,1,Length[y]-1}];
    Table[Length[Select[Join@@Permutations/@allnorm[n],!whkQ[#]&&!whkQ[-#]&]],{n,0,6}]
  • PARI
    R(n,k)={my(v=vector(k,i,1), u=vector(n)); for(r=1, n, if(r%2==0, my(s=v[k]); forstep(i=k, 2, -1, v[i] = s - v[i-1]); v[1] = s); for(i=2, k, v[i] += v[i-1]); u[r]=v[k]); u}
    seq(n)= {concat([0], vector(n,i,1) + sum(k=1, n, (vector(n,i,k^i) - 2*R(n, k))*sum(r=k, n, binomial(r, k)*(-1)^(r-k)) ) )} \\ Andrew Howroyd, Jan 13 2024

Formula

a(n) = A000670(n) - A349058(n).

Extensions

a(9) onwards from Andrew Howroyd, Jan 13 2024

A007179 Dual pairs of integrals arising from reflection coefficients.

Original entry on oeis.org

0, 1, 1, 4, 6, 16, 28, 64, 120, 256, 496, 1024, 2016, 4096, 8128, 16384, 32640, 65536, 130816, 262144, 523776, 1048576, 2096128, 4194304, 8386560, 16777216, 33550336, 67108864, 134209536, 268435456, 536854528, 1073741824, 2147450880, 4294967296, 8589869056
Offset: 0

Views

Author

Keywords

Examples

			From _Gus Wiseman_, Feb 26 2022: (Start)
Also the number of integer compositions of n with at least one odd part. For example, the a(1) = 1 through a(5) = 16 compositions are:
  (1)  (1,1)  (3)      (1,3)      (5)
              (1,2)    (3,1)      (1,4)
              (2,1)    (1,1,2)    (2,3)
              (1,1,1)  (1,2,1)    (3,2)
                       (2,1,1)    (4,1)
                       (1,1,1,1)  (1,1,3)
                                  (1,2,2)
                                  (1,3,1)
                                  (2,1,2)
                                  (2,2,1)
                                  (3,1,1)
                                  (1,1,1,2)
                                  (1,1,2,1)
                                  (1,2,1,1)
                                  (2,1,1,1)
                                  (1,1,1,1,1)
(End)
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Column k=2 of A309748.
Odd bisection is A000302.
Even bisection is A006516 = 2^(n-1)*(2^n - 1).
The complement is counted by A077957, internal version A027383.
The internal case is A274230, even bisection A134057.
A000045(n-1) counts compositions without odd parts, non-singleton A077896.
A003242 counts Carlitz compositions.
A011782 counts compositions.
A034871, A097805, and A345197 count compositions by alternating sum.
A052952 (or A074331) counts non-singleton compositions without even parts.

Programs

  • Magma
    [Floor(2^n/2-2^(n/2)*(1+(-1)^n)/4): n in [0..40]]; // Vincenzo Librandi, Aug 20 2011
    
  • Maple
    f := n-> if n mod 2 = 0 then 2^(n-1)-2^((n-2)/2) else 2^(n-1); fi;
  • Mathematica
    LinearRecurrence[{2,2,-4},{0,1,1},30] (* Harvey P. Dale, Nov 30 2015 *)
    Table[2^(n-1)-If[EvenQ[n],2^(n/2-1),0],{n,0,15}] (* Gus Wiseman, Feb 26 2022 *)
  • PARI
    Vec(x*(1-x)/((1-2*x)*(1-2*x^2)) + O(x^50)) \\ Michel Marcus, Jan 28 2016

Formula

From Paul Barry, Apr 28 2004: (Start)
Binomial transform is (A000244(n)+A001333(n))/2.
G.f.: x*(1-x)/((1-2*x)*(1-2*x^2)).
a(n) = 2*a(n-1)+2*a(n-2)-4*a(n-3).
a(n) = 2^n/2-2^(n/2)*(1+(-1)^n)/4. (End)
G.f.: (1+x*Q(0))*x/(1-x), where Q(k)= 1 - 1/(2^k - 2*x*2^(2*k)/(2*x*2^k - 1/(1 + 1/(2*2^k - 8*x*2^(2*k)/(4*x*2^k + 1/Q(k+1)))))); (continued fraction). - Sergei N. Gladkovskii, May 22 2013
a(n) = A011782(n+2) - A077957(n) - Gus Wiseman, Feb 26 2022

A268956 T(n,k)=Number of length-n 0..k arrays with no repeated value equal to the previous repeated value, with new values introduced in sequential order.

Original entry on oeis.org

1, 1, 2, 1, 2, 3, 1, 2, 4, 5, 1, 2, 4, 11, 7, 1, 2, 4, 12, 29, 11, 1, 2, 4, 12, 39, 77, 15, 1, 2, 4, 12, 40, 138, 201, 23, 1, 2, 4, 12, 40, 153, 499, 525, 31, 1, 2, 4, 12, 40, 154, 634, 1830, 1361, 47, 1, 2, 4, 12, 40, 154, 655, 2785, 6723, 3525, 63, 1, 2, 4, 12, 40, 154, 656, 3045
Offset: 1

Views

Author

R. H. Hardin, Feb 16 2016

Keywords

Comments

Table starts
..1....1.....1.....1.....1.....1.....1.....1.....1.....1.....1.....1.....1
..2....2.....2.....2.....2.....2.....2.....2.....2.....2.....2.....2.....2
..3....4.....4.....4.....4.....4.....4.....4.....4.....4.....4.....4.....4
..5...11....12....12....12....12....12....12....12....12....12....12....12
..7...29....39....40....40....40....40....40....40....40....40....40....40
.11...77...138...153...154...154...154...154...154...154...154...154...154
.15..201...499...634...655...656...656...656...656...656...656...656...656
.23..525..1830..2785..3045..3073..3074..3074..3074..3074..3074..3074..3074
.31.1361..6723.12634.15124.15579.15615.15616.15616.15616.15616.15616.15616
.47.3525.24714.58409.78930.84572.85314.85359.85360.85360.85360.85360.85360

Examples

			Some solutions for n=8 k=4
..0. .0. .0. .0. .0. .0. .0. .0. .0. .0. .0. .0. .0. .0. .0. .0
..1. .1. .1. .0. .1. .1. .1. .1. .1. .1. .1. .1. .1. .1. .1. .1
..2. .2. .2. .1. .2. .2. .0. .1. .1. .2. .2. .2. .2. .0. .2. .2
..2. .3. .2. .0. .3. .3. .2. .2. .2. .1. .2. .3. .1. .1. .0. .1
..1. .4. .3. .2. .4. .2. .1. .3. .3. .3. .3. .1. .0. .2. .0. .3
..1. .3. .4. .1. .4. .2. .3. .0. .3. .3. .3. .4. .2. .1. .3. .4
..2. .2. .0. .2. .3. .4. .0. .1. .1. .1. .2. .0. .0. .2. .1. .2
..0. .0. .0. .3. .1. .1. .3. .2. .4. .3. .1. .0. .0. .1. .0. .2
		

Crossrefs

Column 1 is A052955(n-1).
Column 2 is A267912.
Column 3 is A268069.
Diagonal is A268010.

Formula

Empirical for column k:
k=1: a(n) = a(n-1) +2*a(n-2) -2*a(n-3)
k=2: a(n) = 3*a(n-1) +2*a(n-2) -8*a(n-3) for n>5
k=3: a(n) = 6*a(n-1) -3*a(n-2) -30*a(n-3) +28*a(n-4) +36*a(n-5) -36*a(n-6) for n>8
k=4: [order 9] for n>11
k=5: [order 12] for n>14
k=6: [order 15] for n>17
k=7: [order 18] for n>20

A249723 Numbers n such that there is a multiple of 9 on row n of Pascal's triangle with property that all multiples of 4 on the same row (if they exist) are larger than it.

Original entry on oeis.org

9, 10, 13, 15, 18, 19, 21, 27, 29, 31, 37, 39, 43, 45, 46, 47, 54, 55, 59, 63, 75, 79, 81, 82, 83, 85, 87, 90, 91, 93, 95, 99, 103, 109, 111, 117, 118, 119, 123, 126, 127, 135, 139, 151, 153, 154, 157, 159, 162, 163, 165, 167, 171, 175, 181, 183, 187, 189, 190, 191, 198, 199, 207, 219, 223, 225, 226, 229, 231, 234, 235, 237, 239, 243, 245, 247, 251, 253, 255
Offset: 1

Views

Author

Antti Karttunen, Nov 04 2014

Keywords

Comments

All n such that on row n of A095143 (Pascal's triangle reduced modulo 9) there is at least one zero and the distance from the edge to the nearest zero is shorter than the distance from the edge to the nearest zero on row n of A034931 (Pascal's triangle reduced modulo 4), the latter distance taken to be infinite if there are no zeros on that row in the latter triangle.
A052955 from its eight term onward, 31, 47, 63, 95, 127, ... seems to be a subsequence. See also the comments at A249441.

Examples

			Row 13 of Pascal's triangle (A007318) is: {1, 13, 78, 286, 715, 1287, 1716, 1716, 1287, 715, 286, 78, 13, 1} and the term binomial(13, 5) = 1287 = 9*11*13 occurs before any term which is a multiple of 4. Note that one such term occurs right next to it, as binomial(13, 6) = 1716 = 4*3*11*13, but 1287 < 1716, thus 13 is included.
		

Crossrefs

Complement: A249724.
Natural numbers (A000027) is a disjoint union of the sequences A048278, A249722, A249723 and A249726.

Programs

  • PARI
    A249723list(upto_n) = { my(i=0, n=0); while(i
    				

A267644 T(n,k)=Number of nXk 0..1 arrays with every repeated value in every row and column unequal to the previous repeated value, and new values introduced in row-major sequential order.

Original entry on oeis.org

1, 2, 2, 3, 8, 3, 5, 18, 18, 5, 7, 50, 51, 50, 7, 11, 98, 189, 189, 98, 11, 15, 242, 429, 1015, 429, 242, 15, 23, 450, 1353, 2887, 2887, 1353, 450, 23, 31, 1058, 2829, 12623, 8917, 12623, 2829, 1058, 31, 47, 1922, 8427, 32303, 47715, 47715, 32303, 8427, 1922, 47, 63
Offset: 1

Views

Author

R. H. Hardin, Jan 18 2016

Keywords

Comments

Table starts
..1....2.....3.......5.......7........11........15..........23..........31
..2....8....18......50......98.......242.......450........1058........1922
..3...18....51.....189.....429......1353......2829........8427.......16899
..5...50...189....1015....2887.....12623.....32303......131673......319541
..7...98...429....2887....8917.....47715....128441......647101.....1614281
.11..242..1353...12623...47715....343145...1117207.....7479533....22499181
.15..450..2829...32303..128441...1117207...3696933....30649693....90914453
.23.1058..8427..131673..647101...7479533..30649693...330654951..1225925501
.31.1922.16899..319541.1614281..22499181..90914453..1225925501..4301737251
.47.4418.49443.1277029.8168679.150415627.784186403.13431652713.62439362175

Examples

			Some solutions for n=5 k=4
..0..1..0..1....0..1..0..0....0..1..0..0....0..1..0..0....0..1..0..1
..0..0..1..0....1..0..1..0....1..0..1..1....1..1..0..0....1..0..1..0
..1..1..0..1....1..0..0..1....0..1..0..0....0..0..1..1....0..1..1..0
..1..0..0..1....0..1..1..0....1..0..1..0....0..1..0..0....1..0..0..1
..0..0..1..0....0..1..0..1....0..1..0..1....1..0..1..1....1..1..0..0
		

Crossrefs

Column 1 is A052955(n-1).

Formula

Empirical for column k:
k=1: a(n) = a(n-1) +2*a(n-2) -2*a(n-3)
k=2: a(n) = a(n-1) +6*a(n-2) -6*a(n-3) -8*a(n-4) +8*a(n-5)
k=3: [order 11]
k=4: [order 35]
k=5: [order 93]

A249441 a(n) is the smallest prime whose square divides at least one entry in the n-th row of Pascal's triangle, or 0 if there is no such prime.

Original entry on oeis.org

0, 0, 0, 0, 2, 0, 2, 0, 2, 2, 2, 0, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
Offset: 0

Views

Author

Vladimir Shevelev, Oct 28 2014

Keywords

Comments

a(n) = 3 for 15, 31, 47, 63, 95, 127, 191, 255, 383, 511, 767, 1023, 1535, 2047, 3071, etc.
The above values all occur in A249723 and from 31 onward seem to be given by A052955(n>=8). (Cf. also A249714 & A249715). - Antti Karttunen, Nov 04 2014
Using the Kummer theorem on carries, one can prove that, if a(n)>3 or 0, then n>23 takes the form of either 1...1 or 101...1 in base 2 and simultaneously 212...2 in base 3. However, it is easy to see that this leads to a contradiction. Thus there are no terms greater than 3 and only 8 zeros, i.e., there are only 8 rows in Pascal's triangle that contain all squarefree numbers. It turns out that the latter result has been known for a long time (see A048278).

Crossrefs

Programs

  • Maple
    a_list := proc(len) local s; s := proc(L,p) local n; seq(max(op(map(b-> padic[ordp](b,p),{seq(binomial(n,k),k=0..n)}))),n=0..L); map(k-> `if`(k<2,0,p),[%]) end: zip((x,y)-> `if`(x=0,y,x),s(len,2),s(len,3)) end: a_list(86); # Peter Luschny, Nov 01 2014
    # alternative
    A249441 := proc(n)
        local p,wrks,bi,k;
        if n in [0,1,2,3,5,7,11,23] then
            return 0 ;
        end if;
        p :=2 ;
        while true do
            wrks := false;
            bi := 1 ;
            for k from 0 to n do
                if modp(bi,p^2) = 0 then
                    wrks := true;
                    break;
                end if;
                bi := bi*(n-k)/(1+k) ;
            end do:
            if wrks then
                return p;
            end if;
            p := nextprime(p) ;
        end do:
    end proc: # R. J. Mathar, Nov 04 2014
  • Mathematica
    row[n_] := Table[Binomial[n, k], {k, 1, (n-Mod[n, 2])/2}];
    a[n_] := If[MemberQ[{0, 1, 2, 3, 5, 7, 11, 23}, n], 0, For[p = 2, True, p = NextPrime[p], If[AnyTrue[row[n], Divisible[#, p^2]&], Return[p]]]];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Jul 30 2018 *)
  • PARI
    a(n) = my(o=0); for(k=1,n\2, o+=valuation((n-k+1)/k, 2); if(o>1, return(2))); if(n<24 && n!=15, 0, 3) \\ Charles R Greathouse IV, Nov 03 2014
    
  • PARI
    A249441(n) = { forprime(p=2,3,for(k=0,n\2,if((0==(binomial(n,k)%(p*p))),return(p)))); return(0); } \\ This is more straightforward, but a slower implementation - Antti Karttunen, Nov 03 2014
    
  • PARI
    a(n)=if((n+1)>>valuation(n+1,2)<5, if(n<24 && setsearch([1,2,3,5,7,11,23],n), 0, 3), 2) \\ Charles R Greathouse IV, Nov 06 2014

Extensions

More terms from Peter J. C. Moses, Oct 28 2014
Previous Showing 31-40 of 61 results. Next