Base Spectrum is a working code name for a density plot of a base representation of a number or a sequence of numbers.

Base 2 spectrum may be called binary spectrum, e.g.

Binary spectrum of the natural sequence:

   require 'viewmat trig plot'

   viewmat |: #:i.128

natural.png

Sierpinski Triangle fractal (, ,.~)^:n ,1 is also a Binary Spectrum of the Sloane's A001317

It is defined as "Pascal's triangle mod 2 converted to decimal"

   #. |.2|!/~i.16
1 3 5 15 17 51 85 255 257 771 1285 3855 4369 13107 21845 65535

and can be obtained by recursive formula a(n+1) = a(n) XOR 2a(n)

   viewmat #:(~:/&.#:@, +:)^:(<32) 1

sierpinksi.png

Other binary spectra:

   viewmat |: #: *: i.128         NB. squares

square.png

   viewmat |: #: %: i.128         NB. square roots

sqrt.png

   viewmat |: #: 2^. 1+i.128      NB. log2 x

log2.png

   viewmat |: #:  ^. 1+i.128      NB. ln x

ln.png

   viewmat |: #: ^ 1r32*i.128     NB. exp x

exp.png

   viewmat |: #: cosh 1r32*i:128  NB. cosh x

cosh.png

   viewmat |: #: sinh 1r32*i:128  NB. sinh x

sinh.png

   viewmat |: #: tan 1r16*i.128   NB. tan x

tan.png

Base 3 spectrum may be called ternary spectrum.

Here is some derivations of ternary spectrum of the natural sequence.

   viewmat +./\|:1=(6#3)#:i.3^6   NB. Cantor comb

cantor-comb.png

   viewmat +/\|:1=(6#3)#:i.3^6   NB. Cantor city

cantor-city.png

Same in 3D:

   'wire;boxed 0;viewpoint 2 _1 1.2'plot +/\|:1=(6#3)#:i.3^6

cantor-3d.png

See Also


Contributed by OlegKobchenko.

Essays/Base Spectrum (last edited 2008-12-08 10:45:41 by )