fractal-like plot

Antti Karttunen karttu at
Sat Nov 3 10:25:56 CET 2001

Santi Spadaro wrote:

> Dear seqfans,I think this curious fact deserves your attention: ID
> Number: A064770
> Sequence:  0,1,1,1,2,2,2,2,2,3,10,11,11,11,12,12,12,12,12,13,10,11,11,
> 11,12,12,12,12,12,13,10,11,11,11,12,12,12,12,12,13,20,21,21,
> 21,22,22,22,22,22,23,20,21,21,21,22,22,22,22,22,23,20,21,21,
>            21,22,22,22,22,22,23
> Name:      Replace each digit of n by the floor of its square root.
> Example:   26 -> [1.414...][2.449...] -> 12, so a(26) = 12.
> Keywords:  base,nonn,nice,new
> Offset:    0Author(s): Santi Spadaro (spados at, Oct 19
> 2001 The plot of this sequence shows a curious (even if maybe not so
> surprising) fractal behaviour as you can see from the two plots
> (kindly hosted by Professor Gerard) in the links below:

Dear Santi,

Isn't this a common feature of (almost) any sequence that is generated
doing some transformation to _all_ digits in some base b representation
of n?
See for example, the following permutation of N:

ID Number: A048647
Sequence:  0,3,2,1,12,15,14,13,8,11,10,9,4,7,6,5,48,51,50,49,60,63,62,
Name:      Write n in base 4, then replace each digit by its base 4
Comments:  The graph of a(n) on [ 1..4^k ] resembles a plane fractal of
              dimension 1.
           Self-inverse considered as a permutation of the positive
Links:     J. W. Layman, View fractal-like graph
           Index entries for sequences that are permutations of the
natural numbers
Example:   a(15)=5, since 15 = 33(base 4) -> 11(base 4) = 5.
See also:  Cf. A065256.
Keywords:  nonn,easy,nice
Offset:    0
Author(s): John W. Layman (layman at (7/5/99))

which in turn partly inspired me to concoct this one:

ID Number: A065256
Sequence:  0,3,1,4,2,15,18,16,19,17,5,8,6,9,7,20,23,21,24,22,10,13,11,
Name:      Quintal Queens permutation of N: halve or multiply by 3 (mod
5) each
              digit (0->0, 1->3, 2->1, 3->4, 4->2) of the base-5
              representation of n.
Comments:  All the permutations A004515, and A065256-A065258 consist of
              first fixed term ("Queen on the corner") plus infinitely
              4-cycles, and they satisfy the "non-attacking queen
condition" that
              p(i+d) <> p(i)+-d for all i and d >= 1.
           The corresponding infinite permutation matrix is a
              fractal (Cf. A048647), and any subarray (5^i)x(5^i) (i >=
0) cut
              from its corner gives a solution to the case n=5^i of the
n nonattacking
              queens on nxn chess-board (A000170). Is there any
permutation of N
              which would give solutions to the queen problem with more
              intervals than A000351 ?
Links:     Index entries for sequences that are permutations of the
natural numbers
Maple:     [seq(QuintalQueens0Inv(j),j=0..124)];
           HalveDigit := (d,b) -> op(2,op(1,msolve(2*x=d,b))); # b
should be
              an odd integer >= 3, and d should be in range [0,b-1].
           HalveDigits := proc(n,b) local i;
              add((b^i)*HalveDigit((floor(n/(b^i)) mod
              b),b),i=0..floor(evalf(log[b](n+1)))+1); end;
           QuintalQueens0Inv := n -> HalveDigits(n,5);
See also:  Inverse permutation: A004515. A065256[n] = A065258[n+1]-1.
Cf. also
              A065187, A065189.
Keywords:  nonn,new
Offset:    0
Author(s): Antti.Karttunen at Oct 26 2001



>  For further explorations here's the Mathematica code: f[n_] :=
> Floor[Sqrt[n]]k[n_] := Map[f, IntegerDigits[n]]ndig[a_, b_] := 10a +
> btonum[dig_] := Fold[ndig, 0, dig]j = Table[tonum[k[n]], {n, 1,
> 100}]ListPlot[j] Change 100 in the 5th line with 10^k k=3,4,5,6,7...
> and see what happens.
>  Best Wishes,Santi Spadaro
> --

More information about the SeqFan mailing list