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 A065882 #58 Dec 08 2024 23:51:20 %S A065882 1,2,3,1,1,2,3,2,1,2,3,3,1,2,3,1,1,2,3,1,1,2,3,2,1,2,3,3,1,2,3,2,1,2, %T A065882 3,1,1,2,3,2,1,2,3,3,1,2,3,3,1,2,3,1,1,2,3,2,1,2,3,3,1,2,3,1,1,2,3,1, %U A065882 1,2,3,2,1,2,3,3,1,2,3,1,1,2,3,1,1,2,3,2,1,2,3,3,1,2,3,2,1,2,3,1,1,2,3,2,1 %N A065882 Ultimate modulo 4: right-hand nonzero digit of n when written in base 4. %C A065882 From _Bradley Klee_, Sep 12 2015: (Start) %C A065882 In some guise, this sequence is a linear encoding of the three fixed-point half-hex tilings (cf. Baake & Grimm, Frettlöh). Applying a permutation, morphism x -> 123x becomes x -> x123, which has three fixed points. Applying a partition, morphism x -> x123 becomes x ->{{3,2},{x,1}} or %C A065882 3 2 3 2 %C A065882 3 1 2 1 %C A065882 3 2 3 2 3 2 %C A065882 x -> x 1 -> x 1 1 1 -> etc., %C A065882 which is the substitution rule for the half-hex tiling when the numbers 1,2,3 determine the direction of a dissecting diameter inscribed on each hexagon. %C A065882 (End) %D A065882 M. Baake and U. Grimm, Aperiodic Order Vol. 1, Cambridge University Press, 2013, page 205. %H A065882 Harry J. Smith, <a href="/A065882/b065882.txt">Table of n, a(n) for n = 1..1000</a> %H A065882 D. Frettlöh, <a href="https://www.math.uni-bielefeld.de/~frettloe/papers/diss.pdf">Nichtperiodische Pflasterungen mit ganzzahligem Inflationsfaktor</a>, Dissertation, Universität Dortmund, 2002. %H A065882 <a href="/index/Fi#final">Index entries for sequences related to final digits of numbers</a> %H A065882 <a href="/index/Fi#FIXEDPOINTS">Index entries for sequences that are fixed points of mappings</a> %F A065882 If n mod 4 = 0 then a(n) = a(n/4), otherwise a(n) = n mod 4. a(n) = A065883(n) mod 4. %F A065882 Fixed point of the morphism: 1 ->1231, 2 ->1232, 3 ->1233, starting from a(1) = 1. Sequence read mod 2 gives A035263. a(n) = A007913(n) mod 4. - _Philippe Deléham_, Mar 28 2004 %F A065882 G.f. g(x) satisfies g(x) = g(x^4) + (x + 2 x^2 + 3 x^3)/(1 - x^4). - _Bradley Klee_, Sep 12 2015 %e A065882 a(7)=3 and a(112)=3, since 7 is written in base 4 as 13 and 112 as 1300. %p A065882 f:= proc(n) %p A065882 local x:=n; %p A065882 while x mod 4 = 0 do x:= x/4 od: %p A065882 x mod 4; %p A065882 end proc; %p A065882 map(f, [$1..100]); # _Robert Israel_, Jan 05 2016 %t A065882 Nest[ Flatten[ # /. {1 -> {1, 2, 3, 1}, 2 -> {1, 2, 3, 2}, 3 -> {1, 2, 3, 3}}] &, {1}, 4] (* _Robert G. Wilson v_, May 07 2005 *) %t A065882 b[n_] := CoefficientList[Series[ %t A065882 With[{f0 = (x + 2 x^2 + 3 x^3)/(1 - x^4)}, %t A065882 Nest[ (# /. x -> x^4) + f0 &, f0, Ceiling[Log[4, n/3]]]], %t A065882 {x, 0, n}], x][[2 ;; -1]]; b[100](* _Bradley Klee_, Sep 12 2015 *) %t A065882 Table[Mod[n/4^IntegerExponent[n, 4], 4], {n, 1, 120}] (* _Clark Kimberling_, Oct 19 2016 *) %o A065882 (PARI) a(n) = (n/4^valuation(n,4))%4; \\ _Joerg Arndt_, Sep 13 2015 %o A065882 (Python) %o A065882 def A065882(n): return (n>>((~n & n-1).bit_length()&-2))&3 # _Chai Wah Wu_, Aug 21 2023 %Y A065882 In base 2 this is A000012, base 3 A060236 and base 10 A065881. %Y A065882 Defining relations for g.f. similar to A014577. %Y A065882 Cf. A010873, A037898, A065883, A190593. %K A065882 base,easy,nonn %O A065882 1,2 %A A065882 _Henry Bottomley_, Nov 26 2001