Group Abstract Group Abstract

Message Boards Message Boards

0
|
3.1K Views
|
4 Replies
|
1 Total Like
View groups...
Share
Share this post:

Partition::pdep error how to deal with it in particular situation?

Posted 2 years ago

Hi everyone. I have Partition::pdep Depth 1 requested in object with dimensions {}

error in this code

list = {0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 
   987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 
   121393, 196418, 317811, 514229, 832040, 1346269, 2178309};
crush[n_] := 
 Module[{m = n}, 
  If[m >= 10, While[m >= 10, m = Total[IntegerDigits[m]]]]; m]
Map[crush, list]
colored = 
  digitalRoots /. {r : (1 | 4 | 7) :> Style[r, Red, 24], 
    g : (2 | 5 | 8) :> Style[g, Green, 24], 
    b : (3 | 6 | 9) :> Style[b, Blue, 24]};
Partition[data, 4] // TableForm

Does somebody know how to solve it ?

POSTED BY: Sergey Scorin
4 Replies
Posted 2 years ago

data is not defined.

POSTED BY: Rohit Namjoshi
Posted 2 years ago

Cold you please explain where and how to define it ?

POSTED BY: Sergey Scorin
Posted 2 years ago

Not really, you have not described what you are trying to achieve, and I cannot read your mind. Based on your previous almost identical question, maybe this?

list = {0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 
   987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 
   121393, 196418, 317811, 514229, 832040, 1346269};

digitalRoots = FixedPoint[IntegerDigits/*Total, #] & /@ list

colored = 
 digitalRoots /. {r : (1 | 4 | 7) :> Style[r, Red, 24], 
   g : (2 | 5 | 8) :> Style[g, Green, 24], 
   b : (3 | 6 | 9) :> Style[b, Blue, 24]}

Partition[colored, UpTo@4] // TableForm
POSTED BY: Rohit Namjoshi
Posted 2 years ago

YES! Exactly This ! Could you please help me to hide this output and leave just TableForm like this

POSTED BY: Sergey Scorin
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard