Search NKS | Online
81 - 90 of 255 for Apply
Apply[Take, RealDigits[(N[#, N[Log[10, #] + 3]] &)[ n √ 5 /GoldenRatio 2 + 1/2], GoldenRatio]]
The representations of all the first Fibonacci[n] - 1 numbers can be obtained from (the version in the main text has Rest[RotateLeft[Join[#, {0, 1}]]] & applied)
Apply[Join, Map[Last, NestList[{# 〚 2 〛 ], Join[Map[Join[{1, 0}, Rest[#]] & , # 〚 2 〛 ], Map[Join[{1, 0}, #] &, # 〚 1 〛 ]]} &, {{}, {{1}}}, n-3]]]
The result is that a list is produced which specifies for each cell which element of the rule applies to that cell. … CAEvolveList applies CAStep t times.
Implementation [of sequential substitution systems]
Sequential substitution systems can be implemented quite directly by using Mathematica's standard mechanism for applying transformation rules to symbolic expressions. … The rule on page 82 can then be given simply as
s[1, 0] s[0, 1, 0]
while the rule on page 85 becomes
{s[0, 1, 0] s[0, 0, 1], s[0] s[0, 1, 0]}
The Flat attribute of s makes these rules apply not only for example to the whole sequence s[1, 0, 1, 0] but also to any subsequence such as s[1, 0] .
Iterated aliquot sums
Related to case (b) above is a system which repeats the replacement n Apply[Plus, Divisors[n]] - n or equivalently n DivisorSigma[1, n] - n .
Assuming b > a > 0 , the number of zeros from the second family which appear between the n th and (n + 1) th zero from the first family is
(Floor[(n + 1) #] - Floor[n #] &)[(b - a)/(a + b)]
and as discussed on page 903 this sequence can be obtained by applying a sequence of substitution rules.
The pattern obtained by repeatedly applying the simple geometrical rule shown on the right.
In this chapter my purpose is now to take what we have learned and begin applying it to the study of actual phenomena in nature.
Part of it is that the same basic rules must apply regardless of physical scale.
The arithmetic system takes the value n that it obtains at each step, computes Mod[n, 30] , and then depending on the result applies to n one of the arithmetic operations specified by the rule above.
Specifying an operator f (taken in general to have n arguments with k possible values) by giving the rule number u for f[p, q, …] , the rule number for an expression with variables vars can be obtained from
With[{m = Length[vars]}, FromDigits[ Block[{f = Reverse[IntegerDigits[u, k, k n ]] 〚 FromDigits[ {##}, k] + 1 〛 &}, Apply[Function[Evaluate[vars], expr], Reverse[Array[IntegerDigits[# - 1, k, m] &, k m ]], {1}]], k]]