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-2 of 2 results.

A136690 Final nonzero digit of n! in base 3.

Original entry on oeis.org

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

Views

Author

Carl R. White, Jan 16 2008

Keywords

Examples

			6! = 720 decimal = 222200 ternary, so a(6) = 2.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Mod[6 Times @@ (Rest[ FoldList[{1 + #1[[1]], #2! 2^(#1[[1]] #2)} &, {0, 0}, Reverse[ IntegerDigits[n, 3]]]]), 10][[2]]; # /. {0 -> 1} & /@ Mod[Table[f@n, {n, 0, 104}], 3] (* Robert G. Wilson v, Apr 17 2010 *)
    fnzd[n_]:=Module[{sidn3=Split[IntegerDigits[n!,3]]},If[MemberQ[ Last[ sidn3],0], sidn3[[-2,1]], sidn3[[-1,1]]]]; Array[fnzd,110,0] (* Harvey P. Dale, May 03 2018 *)
  • PARI
    a(n) = vecsum([bittest(220,b) |b<-digits(n,9)])%2 + 1; \\ Kevin Ryde, Dec 03 2022

Formula

From David Radcliffe, Sep 03 2021: (Start)
a(n) = (n! / A060828(n)) mod 3;
a(n) = 1 + (A189672(n) mod 2);
a(6*n) = a(6*n+1) = a(2*n);
a(6*n+2) = 3 - a(2*n);
a(6*n+3) = a(6*n+4) = 3 - a(2*n+1);
a(6*n+5) = a(2*n+1).
(End)
a(n) = A008904(A127110(n)). - Michel Marcus, Sep 04 2021
From Kevin Ryde, Dec 03 2022: (Start)
a(n) = 1 if n written in base 9 has an even number of digits {2,3,4,6,7}; and otherwise a(n) = 2.
Fixed point of the morphism 1 -> 1,1,2,2,2,1,2,2,1; 2 -> 2,2,1,1,1,2,1,1,2; starting from 1.
(End)
a(n) = A212307(n) mod 3. - Ridouane Oudra, Sep 25 2024

Extensions

More terms from Robert G. Wilson v, Apr 17 2010

A125824 Denominator of n!/3^n.

Original entry on oeis.org

1, 3, 9, 9, 27, 81, 81, 243, 729, 243, 729, 2187, 2187, 6561, 19683, 19683, 59049, 177147, 59049, 177147, 531441, 531441, 1594323, 4782969, 4782969, 14348907, 43046721, 4782969, 14348907, 43046721, 43046721, 129140163, 387420489
Offset: 0

Views

Author

Benoit Cloitre, Feb 06 2007

Keywords

Crossrefs

A212307 (numerators).

Programs

  • GAP
    List([0..40], n-> DenominatorRat(Factorial(n)/3^n) ); # G. C. Greubel, Aug 03 2019
  • Magma
    [Denominator(Factorial(n)/3^n): n in [0..40]]; // G. C. Greubel, Aug 03 2019
    
  • Mathematica
    Table[Denominator[n!/3^n], {n,0,40}] (* G. C. Greubel, Aug 03 2019 *)
  • PARI
    a(n)=denominator(n!/3^n)
    
  • Sage
    [denominator(factorial(n)/3^n) for n in (0..40)] # G. C. Greubel, Aug 03 2019
    

Formula

a(0)=1, a(3n+2) = 3^(n+2)*a(n), a(3n+1) = 3^(n+1)*a(n), a(3n) = 3^n*a(n).
a(n) = 3^A089792(n).
a(n) = denominator((1/(2*Pi)) * Integral_{t=0..2*Pi} exp(i*3*t)(-((Pi-t)/i)^n), i=sqrt(-1). - Paul Barry, Apr 02 2007
Showing 1-2 of 2 results.