Simple recursive systems and fractal patterns
[See
for updated version of this page.]
This self-similarity property can be stated as:
where j, and k are any particular positive integers, and n includes all positive integers. Sj(k) is the (single) k-th element of Sj(n), and + is element-wise addition at every index n of the sequence(s). For sequences on the field of natural numbers, or implicitly operating on a finite ring, we can drop the modulo operation and the j notation:Sj(k*n)= ( Sj(n) + Sj(k) ) mod j
S(k*n) = S(n)
+ S(k)
n = p1q * p2r * p3s
...Sj(n) = ( q*S(p1)
+ r*S(p2)
+ s*S(p3) ) mod j
= ( q*Sp(1)
+ r*Sp(2)
+ s*Sp(3) ) mod j
n = 1 2
3 4 5 6 7 8 9 10 11 12
S(n) = 0 1 2 2 3 3 4 3 4 4
5 4 ...
where the prime index elements are underlined.
n = 4 = 22
, S( 4) = 2*S(2)
= 2n = 6 = 2131, S(
6) = 1*S(2) + 1*S(3)
= 3n = 8 = 23
, S( 8) = 3*S(2)
= 3n = 9 = 32
, S( 9) =
2*S(3)
= 4n = 10 = 2151, S(10) = 1*S(2)
+ 1*S(5) =
4n = 12 = 2231, S(12) = 2*S(2)
+ 1*S(3) =
4
The n-th element S(n|pm=1)
is the number of
times the m-th prime, pm, is
a factor of
the index n.
S(n) = 1*S( n | p1=1 )
+ 2*S(
n | p2=1 )
+ 3*S(
n | p3=1 ) ...,
where *,+ indicates element-wise
multiplication and addition of sequences
1*S(n|p1=1)
= 1*(
0 1 0 2 0 1 0 3 0 1
0 2 ... )
2*S(n|p2=1) = 2*(
0 0
1 0 0 1 0 0 2 0
0 1
... )
3*S(n|p3=1) = 3*(
0 0
0 0 1 0 0 0 0 1
0 0
... )
4*S(n|p4=1)
= 4*(
0 0
0 0 0 0 1 0 0 0
0 0
... ) 5*S(n|p5=1)
= 5*( 0 0 0 0 0 0 0 0 0 0
1 0
... )
...
+
____________________________________________________________
S(n) =
0 1
2 2 3 3 4 3 4 4
5 4 ...a' and b' such that: S(a'*n + b') = S(n) + c'{a, b, c}. For the prime generated
sequences the coefficients can be described in terms of only a prime
integer, p, and
the pth element of the sequence, S(p). In this way each prime generated
sequence, with a countably infinite number of
elements,
are analogous to whole numbers in that prime numbers also form the
basis of the countably infinite numbers. This is just a different way
of saying that
every kth element is self-similar to the sequence itself, but the idea
of a base set of coefficients can be applied to sequences with other
self-similarity
properties. For example the Thue-Morse sequence is described (he
thinks) by a base set with only three members.][To Do: Do all of these sequences avoid repetitions in arithmetic progressions? See Words avoiding repetitions in arithmetic progressions, J.-Y. Kao et al.]
n:
1 2 3 4
5
6 7
8
9 10 11
12 13
14 15
16 17
18 ...
prime factors: 21 31
22 51 2131
71 23 32
2151 111 2231
131 2171 3151
24 171 2132
...
for Sp(m) = 1
0 0 0 ...powers of 2's
in prime
factors of n = 0 1 0
2 0
1 0
3
0 1 0 2
0 1
0 4 0
1 ... for Sp(m) = 0
1 0 0 ...powers of 3's
in prime
factors of n = 0 0 1
0 0
1 0
0
2 0 0 1
0 0
1 0 0
2 ...
for Sp(m) = 1
1 0 0 ...powers of 2's and powers
of 3's
in
prime factors (sum of the two rows
above) of n = 0 1
1 2
0
2 0
3 2 1 0
3 0
1 1 4
0
3 ...
for Sp(m) = 1
1 1 1 ...
the sum of all powers in prime
factors of n = 0
1 1
2 1
2 1
3
2 2 1 3
1 2
2 4 1
3 ...
(OEIS A001222,
or Omega(n).
The Liouville
function(n) = -1Omega(n) = A008836.
Note that Sp(m) = 1,1,1, ....)
j = 2, Sp(m) = 1,0,0,0... or p1 = 1
This is a binary sequence (j = 2), where the
n-th element is the parity of the powers of 2 in the prime
factorization of n.
S2(2*n) = 1
0 1 1 1
0 1 0 1
... (OEIS A035263)
S2(2*n) = (
S2(n) + S2(2)
) mod 2, where S2(2)
= 1S2(3*n) = 0
1 0 0 0
1 ...
S2(3*n) = S2(n)
= ( S2(n)
+ 0 ) mod 2
S2(4*n) = 0
1 0 0 ...
S2(4*n) = S2(n)
= ( S2(n)
+ 0 ) mod 2
j = 3, Sp(m) = 1,0,0,0... or p1 = 1
This is a trinary sequence (j = 3), where the n-th element is
the number of 2's in the factorization of n modulo 3. S3(n)
= 0 1 0
2 0
1 0
0
0 1 0 2
0 1
0 1 0
1 ... S3(2*n) = 1
2 1 0 1 2
1 1 1 ... S3(2*n) = (
S3(n) + S3(2) ) mod 3, where S3(2) =
1S2(3*n) = 0
1 0 2 0
1 ...S2(3*n) = S3(n)
= ( S3(n)
+ 0 ) mod 3j = 2, Sp(m) = 0,1,0,0... or p2 = 1
A binary sequence, where the n-th element is
the number of 3's in the factorization of n modulo 2. S2(n)
= 0 0 1
0 0
1 0
0
0 0 0 1
0 0
1 0 0
0 ...
S2(2*n) = 0
0 1 0 0 1
0 0 0 ... S2(2*n) = S2(n) = ( S2(n) + 0 ) mod 2S2(3*n) = 1
1 0 1 1
0 ...S2(3*n) = (
S2(n) + 1 ) mod
2
j = 3, Sp(m) = 0,1,0,0... or p2 = 1
A trinary sequence, where the n-th element is
the number 3's in the factorization of n modulo 3. S3(2*n) = 0
0 1 0 0 1
0 0 2 ... S3(2*n) = S2(n) = ( S3(n)
+ 0 ) mod 3S3(3*n) = 1
1 0 1 1
0 ...S3(3*n) = (
S3(n) + 1 ) mod
3
j = 2, Sp(m) = 1,1,0,0... or p1 and p2 = 1
A binary sequence, where the n-th element is
the number 2's and 3's in the factorization of n modulo 2. S2(n)
= 0 1 1
0 0
0 0
1
0 1 0 1
0 1
1 0 0
1 ...
S2(2*n) = 1
0 0 1 1 1
1 0 1 ... S2(2*n) = (
S2(n) + 1 ) mod
2S2(3*n) = 1
0 0 1 1
1 ...S2(3*n) = (
S2(n) + 1 ) mod
2
j = 2, Sp(m) = 1,1,1,1...
A binary sequence, where the n-th element is
the number of all prime factors of n modulo 2. S2(2*n) = 1
0 0 1 0
1 0 0 1 ... S2(2*n)
= ( S2(n) + 1 ) mod 2
S2(3*n)
= 1 0 0 1
0 1 ...S2(3*n)
= ( S2(n) + 1 ) mod 2
S2(4*n)
= 0 1 1 0 ...S2(4*n)
= S2(n) = ( S2(n) + 0 ) mod 3
All integers, Sp(m) = 1,1,1,1...
The n-th element is
the number of all prime factors of n. S(n)
= 0 1 1
2 1
2 1
3
2 2 1 3
1 2
2 4 1
3 ...
S(2*n) = 1
2 2 3 2
3 2 4 3 ... S(2*n) = S(n) = S(n) + 1S(3*n) = 1
2 2 3 2 3
...S(3*n) = S(n) = S(n) + 1
S(4*n) = 2
3 3 4 ...S(4*n) = S(n) = S(n) + 2
All integers, Sp(m) = 2,3,5,7...Sp(m) = 2
3 5 7 ...
S(n) = 0 2 3 4
5 5 7 6 6 7 11 7 13 9
8 8 ...S(n) = Summ( am*pm ) where the prime factorization of n is
n = p1a1 * p2a2 ...
* pmam
S(n) mod 2 = 0 0 1 0 1 1 1 0 0 1
1 1 1 1 0 0 ...
Sp(m) mod
2 = 0 1 1 1 ...where only the first prime, 2, is even.All integers, Sp(m) = 1,2,3,4...Sp(m)
= 1
2 3 4 ...
S(n) = 0 1 2 2
3 3 4 3 4 4
5 4 6
5 5 4 ...
A pseudo-logarithmic function in the sense that a(b*c) = a(b)+a(c) and so a(b^c) = c*a(b) and f(n) = k^a(n) is a multiplicative function. Essentially a function from the positive integers onto the partitions of the nonnegative integers (1->0, 2->1, 3->2, 4->1+1, 5->3, 6->1+2 etc.) so each value a(n) appears A000041(a(n)) times, first with the a(n)th prime and last with the a(n)th power of 2. Produces triangular numbers from primorials. - Henry Bottomley (se16(AT)btinternet.com), Nov 22 2001
Michael Nyvang writes (May 08 2006) that the Danish composer Karl Aage Rasmussen discovered this sequence in the 1990's: it has excellent musical properties.
S(n) mod 2 = 0 1 0 0 1 1 0 1 0 0
1 0 0 1 1 0 ...
A cube-free word.
A generalized choral sequence c(3n+r_0)=0, c(3n+r_1)=1, c(3n+r_c)=c(n), with r_0=0, r_1=1, and r_c=2. [From Joel Reyes Noche (joel.noche(AT)up.edu.ph), Jul 09 2009]
Sp(m) mod 2 = 1 0 1 0 1 0 ...All integers, Sp(m) = 2,1,2,1,1,2,...Sp(m)
= 2 1 2 1 1 2... (2 for prime indices
that are compound complex numbers, and 1 for Gaussian prime numbers on
the real axis)
Note that every number on the real line that is not a Gaussian prime
can be formed by a product of two complex numbers of the form (a +
bi)(a - bi) = a2 + b2. For example, 13 = 22
+ 32, where 13 is the 6th prime.
S(n) = 0 2 1 4
2 3 1 6 2 4
1 5 2
3 3 8 ...S(n) mod 2 = 0 0 1 0 0 1 1 0 0 0
1 1 0 1 1 0 ...All complex integers, Sp(m) = 1,i,-1,-i,0,0,...Sp(m)
= 1 i -1 -i 0 0...
S(n) = 0 1 i 2
-1 1+i
-i 3
-1 0
0 2+i
0
1-i -1+i 4 ...All integers, Sp(m) = 1,-1,1,-1,1,-1,...Sp(m)
= 1 -1 1 -1 1 -1...
(periodic, zero-mean)
S(n) = 0 1 -1 2
1 0
-1 3
-2 2
1 1
-1
0 0 4 ...
All integers, Sp(m) = 0,1,1,2,1,2,...Sp(m)
= 0 1 1 2 1 2 1 3 2 2 1 3 1 2 2 4 1 3 ...
(big omega)
S(n) = 0 0 1 0
1 1
2 0
2 1
1 1
2
2 2 0 ...
All integers, Sp(m) = 0,1,1,0,1,0,0,1,...Sp(m)
= 0 1 1 0 1 0 0 1 1 0 0 1 ... (Thue-Morse
sequence)
S(n) = 0 0 1 0
1 1
0 0
2 1
1 1
0
0 2 0 ...
All integers, Sp(m) = 1,−1,−1,0,−1,1,−1,0,...Sp(m)
= 1 -1 -1 0 -1
1 -1 0 ... (mobius
function)
S(n) = 0 1 -1 2 -1 0
0 3 -2
0
-1 1
1
1 -2 4 ...
All integers, Sp(m) = 0,1,3,5,3,0,...Sp(m)
= 0 1 3 5 3
0 ... (smallest primitive roots of primes)
S(n) = 0 0 1 0 3 1
5 0
2
3
3 1
0
5 4 0 ...
S2(n)
= 0 1 0 0 0 1 0 1 0 1 0 0 0 1 0 0 0 1 ... , Sp(m)
= 1,0,0,0... or p1 = 1
0 ;
0 --> 0 1
1 --> 0 0
0
(the initial symbol)
0 1
(initial symbol replaced by the rule 0 --> 0 1)0 1 0 0 (each
symbol replaced by the respective rule for each symbol)0 1 0 0 0 1 0 1 (...)...
S2(n),
where Sp(m)
= 1,0,0,0.... or p1
= 1
0; 0 -> 0
1 j
= 2, Sp(m)
= 1,0,0,0... or S2(n|p1=1) 1 -> 0 0
(OEIS A096268
the period-doubling sequence, (A035263 +
1) mod 2, A007814
mod 2, (A001511
+ 1) mod
2)0; 0 -> 0 0
1 j
= 2, Sp(m)
= 0,1,0,0... or S2(n|p2=1) 1 -> 0 0 00; 0 -> 0 0 0 0 1
j = 2, Sp(m)
= 0,0,1,0... or S2(n|p3=1) 1 -> 0 0 0 0 00; 0 -> 0pm-1
1
j = 2, Sp(m)
= 0,0,...1,0,0... or S2(n|pm=1) 1 -> 0pm , where
0pm
indicates the word of pm
0's, 01 02 03 ... 0pm
( 0; 0 -> 0
1
All integers, Sp(m)
= 1,0,0,0... or S(n|p1=1)( 0; 0 -> 0 0
1
All integers, Sp(m)
= 0,1,0,0... or S(n|p2=1)
( 0; 0 -> 0m-1
1
All integers, Sp(m)
= 0,0,...1,0,0... or S(n|pm=1)0m-1
20m-1
30m-1
4
( 0; 0 ->
0m-1 1
j, Sp(m)
= 0,0,...1,0,0... or Sj(n|pm=1)
0; 0 -> 0 1
j
= 3, Sp(m)
= 1,0,0,0... or S3(n|p2=1) 1 -> 0 2
2
-> 0 0
The fixed point is OEIS A096271,
Recurrence: a(2n) = 0, a(2n+1) = (a(n)+1) mod 3
0; 0 -> 0 1 1
j =
2, Sp(m) = 1,1,1,0,1,0,1,0,1,1,0,0,1,0,1,1...
1 -> 0 1 0
Sp(m)
= 1 for pm
= {2,3,5,11,17,23,29,41,47,53,59,71,83...}
1 -> 0
3
Sp(m)
= 1 for pm
= {3,7,11,19,23,31,43,47,59,67,71,79,83...}
2 -> 1 2 3 -> 1 3 )
mod 2
( 0; 0 -> 0 1 0
j = 2, Sp(m) =
0,1,1,0,1,0,1...
1 -> 0 1 1 )
mod 2 Sp(m) = 1
for pm = {2,5,11,17,...}
S(n) = 0 1 0 0 1 1 0 1 0 0 1 0 0
1 1 0 ...
The n-th element Sj(n)
is the number of
times a number in the sequence Scp(m)
= cp1,
cp2,
..., where indices of non-zero elements are pairwise coprime, is
a factor of
the index n, times cpn,
modulo j.
Sj(k*n) = (
Sj(n)
+ Sj(k) ) mod j iff k is 1, Scp(k)
> 0, or k is
pairwise coprime with all Scp(k)
> 0.
Scp(m)
= 0,0,0,1,0,...:S2(n)
= 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 ...
S2(k*n) = S2(n)
+ S2(k) iff k is 1, 4,
or is coprime to 4
Prime
generated
sequences are completely additiveSj(k*n) = (
Sj(n) + Sj(k) ) mod j
#(fkn) = #(fn)
+ #(fk)
#(fkn|pi) = #(fn|pi)
+ #(fk|pi), because every number
has a unique set of prime factors
So for all members of set of primes p (adding the above for all pi in p)
#(fkn|p)
= #(fn|p) + #(fk|p)
for all n and any set of primes p
S(k*n)
= S(n) + S(k)#(fkn|p) mod j = (
#(fn|p) mod j + #(fk|p)
mod j ) mod j, for all n
and any set of primes p
for all j, k, n and any set of primes p.Sj(k*n)= ( Sj(n) + Sj(k) ) mod j
S'(k*n) = (
S'(n) + c'k ) mod j
S'(n) = S(n)
+ S'(1)
S(1) = 0
S(n)such
that:
S(k*n) = S(n) +
ck
ck's
satisfyS(k*1) = S(1)
+ ckck = S(k)S(k*n) = S(n) + S(k)
a > 0b > 0
S(a*b) =
S(a) + S(b)
S'(1),
satisfiesS'(k*n) = (
S'(n) + c'k ) mod j
a*b is a
composite integer, although a or b are not
necessarily composite. This leaves only the values at all prime
indices, pm, undetermined: values at non-prime indices can
be evaluated as unique composites (additions) of values at prime
indices.pm
areSp(m)
= S(pm)
= S(2)
S(3) S(5) ...Sp(m)--
any infinite sequence -- these prime index elements are sufficient
to uniquely find every element
of a k-similar sequence by repeated application of
S(a*b) = S(a)
+ S(b)S(p1q*p2r*p3s...) = q*S(p1)
+ r*S(p2)
+ s*S(p3) ...Sp(m) = S(pm).
They can
be
positive or negative integers, or real values. In fact they can be any
object for which addition is defined -- any additive group.S(k*n) = S(n)
+ S(k)
Sp(m) mod
j
S(n)
= a2*S2(n)
+ a3*S3(n) + a5*S5(n)...
S(pm) =
1 for a single m, pm prime
= 0 for
all other m, pm prime
( 0; 0 ->
0m-1 1
j, Sp(m)
= 1 and Sp(n n.e. m) = 0and are those sequences contructed by j, Sp(m)
= 1 and Sp(n n.e. m) = 0,
so they satisfy
Sj(k*n) = (
Sj(n) + Sj(k) ) mod j
]
Other arithmetic subsequences of completely additive
sequencesPD(n), (j = 2, p = {2})
0; 0 -> 0 1 1 -> 0 0
PD(2*n-1) = 0 = (the trivial sequence of all zeros, or (j =
2, Sp(m) = 0,0,0 ...)
0; 0 -> 0 0
PD(3*n-2) =
0; 0 -> 0 0 0 1 1 -> 0 1 0
1
PD(3*n-1) =
1; 0 -> 1 0 0 0
OR the complement of 0; 0 -> 0
1 1 1 1
-> 1 0 1 0
1
-> 0 1 0 1
PD(4*n-c) = PD(2*n) for even c
= 0 or 1 trivial sequences for
odd c
PD(5*n-4) =
0; 0 -> 0 1 0 0 0 1 0 0
0 1 0 1 0 1 0 0 1 -> 0 1 0 1
0 1 0 0 0 1 0 1 0 1 0 0
Also,
PD( k2*(k1*n-c) ) = PD( k1*n-c
) for parity of 2's in k2's
factors even
= inv(
PD( k1*n-c
) ) for parity of 2's in k2's
factors odd
This is clear from using the prime generating sequence Sp(m) = 1,0,0 ..., which results in S(2) = 1; k2 multiplies the index (k1*n-c) and so changes the number of 2's in the indices factorization by the number of 2's in k2's factorization. For example, with:
k2 = 5, k1 = 3, c = 2;
PD( n' = 5, 20, 7, 10, ... ) =
PD( n' = 1, 4, 7, 10, ... )
we see that the parity 2's in the factors of the indices is unchanged by multiplication with the odd number 5.
PD(3*n-1)are
similar to that of the sequence itself, but with a scaling factor of 4
rather than 2 -- the top 1/4 x 1/4 of the matrices are self-similar to
the full matrix.
![]() |
![]() |
| diff matrix of PD(3*n-2) | diff matrix of PD(3*n-1) |
undiff( S(n) )
= [0] 1 2
3 3 3 3 4
5 4 3 4
4 3 4 6 5
4 ...
S(n)
= 0 1
1
2 1 2 1 3
2 2 1 3
1 2 2 4 1
3 ...
diff2( S(n))
= -1 1 -2 2
-2 3 -3 1
-1 ...
=
2 -3 4 -4
5 -6 4 -2
-1 ...
= -5
7 -8 9
-11 10 -6 1 ...
= 12 -15 17 -20
21 -16 7 ...
It would be nice to see the diagrams for
these. What is the left column complement for this sequence? 0 1 -1 0 2
-5 12 ...
S(n)
= 0
1
1
2 1 2 2 3
1 2 2 3
2 3 3 4 1
2 ...
diff( S(n))
= 1 0 1
-1 1 0 1 -2
1 0 1 -1
1 0 1 -3 1 ...
diff2( S(n))
= -1 1 -2 2
-1 1 -3 3
-1 ...