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.

A111394 a(n) = product of first n integers not divisible by 3.

Original entry on oeis.org

1, 2, 8, 40, 280, 2240, 22400, 246400, 3203200, 44844800, 717516800, 12197785600, 231757926400, 4635158528000, 101973487616000, 2345390215168000, 58634755379200000, 1524503639859200000, 42686101916057600000, 1237896955565670400000, 38374805622535782400000
Offset: 1

Views

Author

Jon Perry, Nov 11 2005

Keywords

Examples

			a(5) = 1*2*4*5*7 = 280.
		

Programs

  • Maple
    a:= proc(n) a(n):= `if`(n=1, 1, (3*iquo(n, 2)-(-1)^n)*a(n-1)) end:
    seq (a(n), n=1..25);  # Alois P. Heinz, Oct 03 2012
  • Mathematica
    a[n_] := ((3*n-Mod[n, 2])/2)!/(3^((n-Mod[n, 2])/2)*((n-Mod[n, 2])/2)!); Table[a[n], {n, 1, 21}] (* Jean-François Alcover, Feb 25 2014 *)
    FoldList[Times,Table[If[Divisible[n,3],Nothing,n],{n,40}]] (* Harvey P. Dale, Feb 28 2023 *)
  • PARI
    {a(n)=local(A,G=sum(k=0,n,binomial(3*k,k)/(2*k+1)*x^k +x*O(x^n))); A=1/(1-x*subst(G,x,x^2/3))-1; n!*polcoeff(A,n)} \\ Paul D. Hanna, Jan 04 2014
    
  • PARI
    {a(n)=local(A=x); for(i=0, n, A=intformal((1+A)^3*subst(1+A, x,-x +x*O(x^n))^1 +x*O(x^n) )); n!*polcoeff(A, n)} \\ Paul D. Hanna, Jan 04 2014
  • Sage
    def Gauss_factorial(N, n): return mul(j for j in (1..N) if gcd(j, n) == 1)
    def A111394_list(n): return sorted(set([Gauss_factorial(j, 3) for j in (1..n)]))
    A111394_list(28) # Peter Luschny, Oct 01 2012
    

Formula

Let b(n) = n!/(3^floor(n/3)*floor(n/3)!) then a(n) = b(3*floor(n/2)+(-1)^(n+1)). # formula corrected Peter Luschny, Oct 03 2012
E.g.f.: 1/(1 - x*G(x^2/3)) - 1 where G(x) = 1 + x*G(x)^3 is the g.f. of A001764. - Paul D. Hanna, Jan 04 2014
E.g.f. A(x) satisfies: A'(x) = (1 + A(x))^3 * (1 + A(-x)). - Paul D. Hanna, Jan 04 2014