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.

Showing 1-10 of 12 results. Next

A092428 Numbers n such that A092255(n) == 2 (mod 3).

Original entry on oeis.org

4, 10, 12, 13, 28, 30, 31, 36, 37, 39, 40, 82, 84, 85, 90, 91, 93, 94, 108, 109, 111, 112, 117, 118, 120, 121, 244, 246, 247, 252, 253, 255, 256, 270, 271, 273, 274, 279, 280, 282, 283, 324, 325, 327, 328, 333, 334, 336, 337, 351, 352, 354, 355, 360, 361, 363
Offset: 1

Views

Author

Benoit Cloitre, Mar 22 2004

Keywords

Programs

  • PARI
    for(n=1,775,if(binomial(2*n,n)%3*abs(gcd(3^50,n)-n)>0,print1(n,",")))

Formula

A092255(n) == 2 (mod 3) iff n is not a power of 3 or n is not in A074940

A092037 A092255 mod 3.

Original entry on oeis.org

1, 1, 0, 1, 2, 0, 0, 0, 0, 1, 2, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 2, 2, 0, 0, 0, 0, 2, 2, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 2, 2, 0, 0, 0, 0, 2, 2, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

Benoit Cloitre, Mar 27 2004

Keywords

Crossrefs

Formula

a(n)=0 iff n is in A074940; a(n)=1 iff n is a power of 3; a(n)=2 iff n is in A092428.

A074940 Numbers having at least one 2 in their ternary representation.

Original entry on oeis.org

2, 5, 6, 7, 8, 11, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 29, 32, 33, 34, 35, 38, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 83, 86, 87, 88, 89, 92
Offset: 1

Views

Author

Benoit Cloitre and Reinhard Zumkeller, Oct 04 2002; revised Dec 03 2003

Keywords

Comments

Also, numbers m such that 3 divides C(2m,m).
Also, numbers m such that the central trinomial coefficient A002426(m) == 0 (mod 3). - Emeric Deutsch and Bruce E. Sagan, Dec 04 2003
Also, numbers m such that A092255(m) == 0 (mod 3). - Benoit Cloitre, Mar 22 2004
Also, numbers m such that the coefficient of x^m equals 0 in Product_{k>=0} (1-x^(3^k)). - N. J. A. Sloane, Jun 01 2010

Examples

			12 is not in the sequence since it is 110_3, but 11 is in the sequence since it is 102_3. - _Michael B. Porter_, Jun 30 2016
		

Crossrefs

Complement of A005836.
A039966(a(n)) = 0.

Programs

  • Haskell
    a074940 n = a074940_list !! (n-1)
    a074940_list = filter ((== 0) . a039966) [0..]
    -- Reinhard Zumkeller, Jun 06 2012, Sep 29 2011
    
  • Mathematica
    Select[Range@ 120, MemberQ[IntegerDigits[#, 3], 2] &] (* or *)
    Select[Range@ 120, Divisible[Binomial[2 #, #], 3] &] (* Michael De Vlieger, Jun 29 2016 *)
    Select[Range[100],DigitCount[#,3,2]>0&] (* Harvey P. Dale, Aug 25 2019 *)
  • PARI
    is(n)=while(n,if(n%3==2,return(1));n\=3);0 \\ Charles R Greathouse IV, Aug 21 2011
    
  • Python
    from gmpy2 import digits
    def A074940(n):
        def f(x):
            s = digits(x,3)
            for i in range(l:=len(s)):
                if s[i]>'1':
                    break
            else:
                return n+int(s,2)
            return n+int(s[:i]+'1'*(l-i),2)
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Oct 29 2024

Formula

a(n) = n + O(n^0.631). - Charles R Greathouse IV, Aug 21 2011

Extensions

More terms from Emeric Deutsch and Bruce E. Sagan, Dec 04 2003

A226873 Number A(n,k) of n-length words w over a k-ary alphabet {a1,a2,...,ak} such that #(w,a1) >= #(w,a2) >= ... >= #(w,ak) >= 0, where #(w,x) counts the letters x in word w; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 3, 1, 0, 1, 1, 3, 4, 1, 0, 1, 1, 3, 10, 11, 1, 0, 1, 1, 3, 10, 23, 16, 1, 0, 1, 1, 3, 10, 47, 66, 42, 1, 0, 1, 1, 3, 10, 47, 126, 222, 64, 1, 0, 1, 1, 3, 10, 47, 246, 522, 561, 163, 1, 0, 1, 1, 3, 10, 47, 246, 882, 1821, 1647, 256, 1, 0
Offset: 0

Views

Author

Alois P. Heinz, Jun 21 2013

Keywords

Examples

			A(4,3) = 23: aaaa, aaab, aaba, aabb, aabc, aacb, abaa, abab, abac, abba, abca, acab, acba, baaa, baab, baac, baba, baca, bbaa, bcaa, caab, caba, cbaa.
Square array A(n,k) begins:
  1, 1,  1,   1,    1,    1,    1,     1, ...
  0, 1,  1,   1,    1,    1,    1,     1, ...
  0, 1,  3,   3,    3,    3,    3,     3, ...
  0, 1,  4,  10,   10,   10,   10,    10, ...
  0, 1, 11,  23,   47,   47,   47,    47, ...
  0, 1, 16,  66,  126,  246,  246,   246, ...
  0, 1, 42, 222,  522,  882, 1602,  1602, ...
  0, 1, 64, 561, 1821, 3921, 6441, 11481, ...
		

Crossrefs

Main diagonal gives: A005651.

Programs

  • Maple
    b:= proc(n, i, t) option remember;
          `if`(t=1, 1/n!, add(b(n-j, j, t-1)/j!, j=i..n/t))
        end:
    A:= (n, k)-> `if`(k=0, `if`(n=0, 1, 0), n!*b(n, 0, k)):
    seq(seq(A(n, d-n), n=0..d), d=0..14);
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = If[t == 1, 1/n!, Sum[b[n-j, j, t-1]/j!, {j, i, n/t}]]; a[n_, k_] := If[k == 0, If[n == 0, 1, 0], n!*b[n, 0, k]]; Table[Table[a[n, d-n], {n, 0, d}], {d, 0, 14}] // Flatten (* Jean-François Alcover, Dec 13 2013, translated from Maple *)

Formula

A(n,k) = Sum_{i=0..min(n,k)} A226874(n,i).

A027914 T(n,0) + T(n,1) + ... + T(n,n), T given by A027907.

Original entry on oeis.org

1, 2, 6, 17, 50, 147, 435, 1290, 3834, 11411, 34001, 101400, 302615, 903632, 2699598, 8068257, 24121674, 72137547, 215786649, 645629160, 1932081885, 5782851966, 17311097568, 51828203475, 155188936431, 464732722872
Offset: 0

Views

Author

Keywords

Comments

Let b(n)=a(n) mod 2; then b(n)=1/2+(-1)^n*(1/2-A010060(floor(n/2))). - Benoit Cloitre, Mar 23 2004
Binomial transform of A027306. Inverse binomial transform of = A032443. Hankel transform is {1, 2, 3, 4, ..., n, ...}. - Philippe Deléham, Jul 20 2005
Sums of rows of the triangle in A111808. - Reinhard Zumkeller, Aug 17 2005
Number of 3-ary words of length n in which the number of 1's does not exceed the number of 0's. - David Scambler, Aug 14 2012
The Gauss congruences a(n*p^k) == a(n^p^(k-1)) (mod p^k) hold for prime p and positive integers n and k. - Peter Bala, Jan 07 2022

Crossrefs

Programs

  • Haskell
    a027914 n = sum $ take (n + 1) $ a027907_row n
    -- Reinhard Zumkeller, Jan 22 2013
  • Maple
    a := n -> simplify((3^n + GegenbauerC(n,-n,-1/2))/2):
    seq(a(n), n=0..25); # Peter Luschny, May 12 2016
  • Mathematica
    CoefficientList[ Series[ (1 + x + Sqrt[1 - 2x - 3x^2])/(2 - 4x - 6x^2), {x, 0, 26}], x] (* Robert G. Wilson v, Jul 21 2015 *)
    Table[(3^n + Hypergeometric2F1[1/2 - n/2, -n/2, 1, 4])/2, {n, 0, 20}] (* Vladimir Reshetnikov, May 07 2016 *)
    f[n_] := Plus @@ Take[ CoefficientList[ Sum[x^k, {k, 0, 2}]^n, x], n +1]; Array[f, 26, 0] (* Robert G. Wilson v, Jan 30 2017 *)
  • PARI
    a(n)=sum(i=0,n,polcoeff((1+x+x^2)^n,i,x))
    
  • PARI
    a(n)=sum(i=0,n,sum(j=0,n,sum(k=0,j,if(i+j+k-n,0,(n!/i!/j!/k!)))))
    
  • PARI
    x='x+O('x^99); Vec((1+x+(1-2*x-3*x^2)^(1/2))/(2*(1-2*x-3*x^2))) \\ Altug Alkan, May 12 2016
    

Formula

a(n) = ( 3^n + A002426(n) )/2; lim n -> infinity a(n+1)/a(n) = 3; 3^n < 2*a(n) < 3^(n+1). - Benoit Cloitre, Sep 28 2002
From Benoit Cloitre, Jan 26 2003: (Start)
a(n) = (1/2) *( Sum{k = 0..n} binomial(n,k)*binomial(n-k,k) + 3^n );
a(n) = Sum_{k = 0..n} Sum_{i = 0..k} binomial(n,i)*binomial(n-i,k);
a(n) = 3^n/2*(1+c/sqrt(n)+O(n^-1/2)) where c=0.5... (End)
c = sqrt(3/Pi)/2 = 0.4886025119... - Vaclav Kotesovec, May 07 2016
a(n) = n!*Sum(i+j+k=n, 1/(i!*j!*k!)) 0<=i<=n, 0<=k<=j<=n. - Benoit Cloitre, Mar 23 2004
G.f.: (1+x+sqrt(1-2x-3x^2))/(2(1-2x-3x^2)); a(n) = Sum_{k = 0..n} floor((k+2)/2)*Sum_{i = 0..floor((n-k)/2)} C(n,i)*C(n-i,i+k)* ((k+1)/(i+k+1)). - Paul Barry, Sep 23 2005; corrected Jan 20 2008
D-finite with recurrence: n*a(n) +(-5*n+4)*a(n-1) +3*(n-2)*a(n-2) +9*(n-2)*a(n-3)=0. - R. J. Mathar, Dec 02 2012
G.f.: (1+x+1/G(0))/(2*(1-2*x-3*x^2)), where G(k)= 1 + x*(2+3*x)*(4*k+1)/(4*k+2 - x*(2+3*x)*(4*k+2)*(4*k+3)/(x*(2+3*x)*(4*k+3) + 4*(k+1)/G(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Jul 30 2013
From Peter Bala, Jul 21 2015: (Start)
a(n) = [x^n]( 3*x - 1/(1 - x) )^n.
1 + x*exp( Sum_{n >= 1} a(n)*x^n/n ) = 1 + x + 2*x^2 + 5*x^3 + 13*x^4 + 35*x^5 + ... is the o.g.f. for A005773. (End)
a(n) = (3^n + GegenbauerC(n,-n,-1/2))/2. - Peter Luschny, May 12 2016

A092429 a(n) = n! * Sum_{i,j,k,l >= 0, i+j+k+l = n} 1/(i!*j!*k!*l!).

Original entry on oeis.org

1, 1, 3, 10, 47, 126, 522, 1821, 8143, 26326, 109958, 396111, 1737122, 5998955, 24949277, 91979985, 397402223, 1418993350, 5881338702, 22010456331, 94022106862, 342803313261, 1416758002487, 5356198979731, 22685035586290, 83911052895151, 345921828889367
Offset: 0

Views

Author

Benoit Cloitre, Mar 22 2004

Keywords

Comments

a(n) is even iff n is a sum of 2 distinct powers of 2.

Crossrefs

Column k=4 of A226873. - Alois P. Heinz, Jun 21 2013

Programs

  • Maple
    b:= proc(n, i, t) option remember;
          `if`(t=1, 1/n!, add(b(n-j, j, t-1)/j!, j=i..n/t))
        end:
    a:= n-> n!*b(n, 0, 4):
    seq(a(n), n=0..30);  # Alois P. Heinz, Sep 21 2017
  • Mathematica
    Table[Sum[Sum[Sum[Sum[If[i+j+k+l==n,n!/i!/j!/k!/l!,0],{l,0,k}],{k,0,j}],{j,0,i}],{i,0,n}],{n,0,20}] (* Vaclav Kotesovec, Jul 01 2013 *)
    CoefficientList[Series[(HypergeometricPFQ[{},{},x]^4 +6*HypergeometricPFQ[{},{},x]^2 *HypergeometricPFQ[{},{1},x^2] +8*HypergeometricPFQ[{},{},x] *HypergeometricPFQ[{},{1,1},x^3] +3*HypergeometricPFQ[{},{1},x^2]^2 +6*HypergeometricPFQ[{},{1,1,1},x^4])/24, {x, 0, 20}], x]* Range[0, 20]! (* Vaclav Kotesovec after Vladeta Jovovic, Jul 01 2013 *)
  • PARI
    a(n)=sum(i=0,n,sum(j=0,i,sum(k=0,j,sum(l=0,k,if(i+j+k+l-n,0,n!/i!/j!/k!/l!)))))

Formula

E.g.f.: (t(1)^4 + 6*t(1)^2*t(2) + 8*t(1)*t(3) + 3*t(2)^2 + 6*t(4))/24 where t(1) = hypergeom([],[],x), t(2) = hypergeom([],[1],x^2), t(3) = hypergeom([],[1,1],x^3) and t(4) = hypergeom([],[1,1,1],x^4). - Vladeta Jovovic, Sep 22 2007, typo corrected by Vaclav Kotesovec, Jul 01 2013
Conjecture: a(n) ~ 4^n/4!. - Vaclav Kotesovec, Mar 07 2014

A079318 a(0) = 1; for n > 0, a(n) = (3^(A000120(n)-1) + 1)/2.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 2, 5, 1, 2, 2, 5, 2, 5, 5, 14, 1, 2, 2, 5, 2, 5, 5, 14, 2, 5, 5, 14, 5, 14, 14, 41, 1, 2, 2, 5, 2, 5, 5, 14, 2, 5, 5, 14, 5, 14, 14, 41, 2, 5, 5, 14, 5, 14, 14, 41, 5, 14, 14, 41, 14, 41, 41, 122, 1, 2, 2, 5, 2, 5, 5, 14, 2, 5, 5, 14, 5, 14, 14, 41, 2, 5, 5, 14, 5, 14, 14, 41, 5, 14, 14
Offset: 0

Views

Author

N. J. A. Sloane, Feb 12 2003

Keywords

Examples

			From _Omar E. Pol_, Jul 18 2009: (Start)
If written as a triangle:
1;
1;
1,2;
1,2,2,5;
1,2,2,5,2,5,5,14;
1,2,2,5,2,5,5,14,2,5,5,14,5,14,14,41;
1,2,2,5,2,5,5,14,2,5,5,14,5,14,14,41,2,5,5,14,5,14,14,41,5,14,14,41,14,41,41,122;
(End)
		

References

  • Alex Fink, Aviezri S. Fraenkel and Carlos Santos, LIM is not slim, International Journal of Game Theory, May 2013
  • David Singmaster, On the cellular automaton of Ulam and Warburton, M500 Magazine of the Open University, #195 (December 2003), pp. 2-7.

Crossrefs

Programs

  • Mathematica
    a[n_] := (3^(DigitCount[n, 2, 1] - 1) + 1)/2; a[0] = 1; Array[a, 100, 0] (* Amiram Eldar, Jul 29 2023 *)

Formula

For n>=1, a(n) mod 2 = A010060(n), the Thue-Morse sequence - Benoit Cloitre, Mar 23 2004
a(n) = Sum_{i+j+k=n, 0<=k<=j<=i<=n} (n!/(i!*j!*k!) mod 2). - Benoit Cloitre, Jul 02 2004

A226875 Number of n-length words w over a 5-ary alphabet {a1,a2,...,a5} such that #(w,a1) >= #(w,a2) >= ... >= #(w,a5) >= 0, where #(w,x) counts the letters x in word w.

Original entry on oeis.org

1, 1, 3, 10, 47, 246, 882, 3921, 18223, 84790, 432518, 1863951, 8892842, 42656147, 204204353, 1025014815, 4728033983, 22948258742, 111605089014, 541696830843, 2708218059022, 12861557284425, 62938669549583, 308273057334413, 1508708926286914, 7533652902408071
Offset: 0

Views

Author

Alois P. Heinz, Jun 21 2013

Keywords

Crossrefs

Column k=5 of A226873.

Programs

  • Maple
    b:= proc(n, i, t) option remember;
          `if`(t=1, 1/n!, add(b(n-j, j, t-1)/j!, j=i..n/t))
        end:
    a:= n-> n!*b(n, 0, 5):
    seq(a(n), n=0..30);
  • Mathematica
    Table[Sum[Sum[Sum[Sum[Sum[If[i+j+k+l+m==n,n!/i!/j!/k!/l!/m!,0],{m,0,l}],{l,0,k}],{k,0,j}],{j,0,i}],{i,0,n}],{n,0,20}] (* Vaclav Kotesovec, Jul 01 2013 *)
    CoefficientList[Series[(HypergeometricPFQ[{},{},x]^5 + 10*HypergeometricPFQ[{},{},x]^3*HypergeometricPFQ[{},{1},x^2] + 20*HypergeometricPFQ[{},{},x]^2*HypergeometricPFQ[{},{1,1},x^3] + 20*HypergeometricPFQ[{},{1},x^2]*HypergeometricPFQ[{},{1,1},x^3] + 15*HypergeometricPFQ[{},{1},x^2]^2*HypergeometricPFQ[{},{},x] + 30*HypergeometricPFQ[{},{1,1,1},x^4]*HypergeometricPFQ[{},{},x] + 24*HypergeometricPFQ[{},{1,1,1,1},x^5])/5!,{x,0,20}],x]*Range[0,20]! (* more efficient, Vaclav Kotesovec, Jul 01 2013 *)

Formula

Conjecture: a(n) ~ 5^n/5!. - Vaclav Kotesovec, Mar 07 2014

A292718 Number of multisets of nonempty words with a total of n letters over ternary alphabet such that within each word every letter of the alphabet is at least as frequent as the subsequent alphabet letter.

Original entry on oeis.org

1, 1, 4, 14, 43, 139, 495, 1544, 5111, 17348, 55520, 181946, 607300, 1951262, 6362769, 20972812, 67451405, 218884282, 715353298, 2298626230, 7429125757, 24124615697, 77400570114, 249285637563, 805472940377, 2579640351769, 8283108375403, 26655874638762
Offset: 0

Views

Author

Alois P. Heinz, Sep 21 2017

Keywords

Crossrefs

Column k=3 of A292712.

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(t=1, 1/n!,
          add(b(n-j, j, t-1)/j!, j=i..n/t))
        end:
    a:= proc(n) option remember; `if`(n=0, 1, add(add(d*d!*
          b(d, 0, 3), d=numtheory[divisors](j))*a(n-j), j=1..n)/n)
        end:
    seq(a(n), n=0..35);

Formula

G.f.: Product_{j>=1} 1/(1-x^j)^A092255(j).
Euler transform of A092255.

A340410 Number of sets of nonempty words with a total of n letters over ternary alphabet such that within each word every letter of the alphabet is at least as frequent as the subsequent alphabet letter.

Original entry on oeis.org

1, 1, 3, 13, 36, 122, 433, 1356, 4449, 15279, 48567, 158837, 532415, 1704777, 5547148, 18335536, 58815602, 190574866, 623885902, 2000945191, 6459510350, 20998728429, 67275468661, 216477522426, 699952967976, 2239210854373, 7184690267832, 23131348476391
Offset: 0

Views

Author

Alois P. Heinz, Jan 06 2021

Keywords

Examples

			a(3) = 13: {aaa}, {aab}, {aba}, {baa}, {abc}, {acb}, {bac}, {bca}, {cab}, {cba}, {aa,a}, {ab,a}, {ba,a}.
		

Crossrefs

Column k=3 of A292795.
Cf. A092255.

Programs

  • Maple
    b:= proc(n, i, t) option remember; `if`(t=1, 1/n!,
          add(b(n-j, j, t-1)/j!, j=i..n/t))
        end:
    g:= (n, k)-> `if`(k=0, `if`(n=0, 1, 0), n!*b(n, 0, k)):
    h:= proc(n, i, k) option remember; `if`(n=0, 1, `if`(i<1, 0,
          add(h(n-i*j, i-1, k)*binomial(g(i, k), j), j=0..n/i)))
        end:
    a:= n-> h(n$2, min(n, 3)):
    seq(a(n), n=0..32);

Formula

G.f.: Product_{j>=1} (1+x^j)^A092255(j).
Showing 1-10 of 12 results. Next