A163914 Number of 3-cycles in range [A000302(n-1)..A024036(n)] of permutation A163355/A163356.
0, 0, 2, 1, 10, 9, 54, 57, 295, 329, 1613, 1834, 8812, 10072
Offset: 0
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.
A006068(n)= { my(s=1, ns); while(1, ns = n >> s; if(0==ns, break()); n = bitxor(n, ns); s <<= 1; ); return (n); } \\ From A006068 A064707(n) = A006068(A006068(n)); A057300(n) = { my(t=1,s=0); while(n>0, if(1==(n%4),n++,if(2==(n%4),n--)); s += (n%4)*t; n >>= 2; t <<= 2); (s); }; A163355(n) = if(!n,n,my(i = (#binary(n)-1)\2, f = 4^i, d = (n\f)%4, r = (n%f)); if(((1==d)&&!(i%2))||((2==d)&&(i%2)), f+A163355(A057300(r)), if(3==d,f+f+A163355(A057300(r)), (3*f)+A163355(f-1-r)))); A302845(n) = A163355(A064707(n));
A006068(n)= { my(s=1, ns); while(1, ns = n >> s; if(0==ns, break()); n = bitxor(n, ns); s <<= 1; ); return (n); } \\ From A006068 A057300(n) = { my(t=1, s=0); while(n>0, if(1==(n%4),n++,if(2==(n%4),n--)); s += (n%4)*t; n >>= 2; t <<= 2); (s); }; A163355(n) = if(!n,n,my(i = (#binary(n)-1)\2, f = 4^i, d = (n\f)%4, r = (n%f)); if(((1==d)&&!(i%2))||((2==d)&&(i%2)), f+A163355(A057300(r)), if(3==d,f+f+A163355(A057300(r)), (3*f)+A163355(f-1-r)))); A302843(n) = A163355(A006068(n));
The top left 8 X 8 corner of the array shows how this surjective self-avoiding walk begins (connect the terms in numerical order, 0-1-2-3-...): 0 1 14 15 16 19 20 21 3 2 13 12 17 18 23 22 4 7 8 11 30 29 24 25 5 6 9 10 31 28 27 26 58 57 54 53 32 35 36 37 59 56 55 52 33 34 39 38 60 61 50 51 46 45 40 41 63 62 49 48 47 44 43 42
b[{n_, k_}, {m_}] := (A[k, n] = m-1); MapIndexed[b, List @@ HilbertCurve[4][[1]]]; Table[A[n-k, k], {n, 0, 12}, {k, n, 0, -1}] // Flatten (* Jean-François Alcover, Mar 07 2021 *)
a[n_] := FromDigits[With[{d = Reverse@IntegerDigits[n, 3]}, Reverse@Table[ If[EvenQ@Total@d[[j+1 ;; ;; 2]], d[[j]], 2-d[[j]]], {j, Length@d}]], 3]; Array[a, 100] (* Andrey Zabolotskiy, Apr 08 2021, after Kevin Ryde *)
a(n) = my(v=digits(n,3)); for(start=2,3, my(s=0); forstep(i=start,#v,2, s+=v[i-1]; if(s%2,v[i]=2-v[i]))); fromdigits(v,3); \\ Kevin Ryde, Sep 04 2020
The top left 8x8 corner of this array: +0 +1 +9 10 16 18 20 21 +2 +3 11 +8 19 17 22 23 14 12 +4 +6 27 25 30 29 15 13 +7 +5 26 24 28 31 47 45 39 37 58 56 54 53 44 46 38 36 57 59 52 55 40 41 33 34 49 51 60 61 42 43 35 32 48 50 62 63
Comments