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.
%I A136690 #34 Sep 25 2024 23:12:35 %S A136690 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, %T A136690 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, %U A136690 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 %N A136690 Final nonzero digit of n! in base 3. %H A136690 Kevin Ryde, <a href="/A136690/b136690.txt">Table of n, a(n) for n = 0..10000</a> %H A136690 <a href="/index/Fi#FIXEDPOINTS">Index entries for sequences that are fixed points of mappings</a> %F A136690 From _David Radcliffe_, Sep 03 2021: (Start) %F A136690 a(n) = (n! / A060828(n)) mod 3; %F A136690 a(n) = 1 + (A189672(n) mod 2); %F A136690 a(6*n) = a(6*n+1) = a(2*n); %F A136690 a(6*n+2) = 3 - a(2*n); %F A136690 a(6*n+3) = a(6*n+4) = 3 - a(2*n+1); %F A136690 a(6*n+5) = a(2*n+1). %F A136690 (End) %F A136690 a(n) = A008904(A127110(n)). - _Michel Marcus_, Sep 04 2021 %F A136690 From _Kevin Ryde_, Dec 03 2022: (Start) %F A136690 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. %F A136690 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. %F A136690 (End) %F A136690 a(n) = A212307(n) mod 3. - _Ridouane Oudra_, Sep 25 2024 %e A136690 6! = 720 decimal = 222200 ternary, so a(6) = 2. %t A136690 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 *) %t A136690 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 *) %o A136690 (PARI) a(n) = vecsum([bittest(220,b) |b<-digits(n,9)])%2 + 1; \\ _Kevin Ryde_, Dec 03 2022 %Y A136690 Cf. A000142, A127110. %Y A136690 Other bases: A136691, A136692, A136693, A136694, A136695, A136696, A008904, A136697, A136698, A136699, A136700, A136701, A136702, A212307. %K A136690 base,easy,nonn %O A136690 0,3 %A A136690 _Carl R. White_, Jan 16 2008 %E A136690 More terms from _Robert G. Wilson v_, Apr 17 2010