Group Abstract Group Abstract

Message Boards Message Boards

0
|
9.1K Views
|
14 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Finding Happy/Sad Numbers

Anonymous User
Anonymous User
Posted 10 years ago
POSTED BY: Anonymous User
14 Replies
Posted 10 years ago
POSTED BY: Eric Rimbey

You are welcome

POSTED BY: Marian Muresan

On your topic I suggest you the book HAZRAT, R., Mathematica: A Problem-Centered Approach, Springer, 2010, Springer Undergraduate Mathematics Series, London, xv+188.

Marian

POSTED BY: Marian Muresan
Anonymous User
Anonymous User
Posted 10 years ago

Thank you for your suggestion :)

POSTED BY: Anonymous User

Every number eventually returns a 1 or 4 in the ones place. I think what you're trying to do is count how many iterations it takes before you get there. If so, here's the answer:

y = 0; Do[y = x; i = 0; 
 While[y != 1 && y != 4, i++; 
  y = Total[Power[#, 2] & /@ ToExpression@Characters[ToString@y]]];
 Print[{x,i, y}], {x, 99}]
POSTED BY: Eric Smith
Anonymous User
Anonymous User
Posted 10 years ago
POSTED BY: Anonymous User
POSTED BY: Eric Smith
Anonymous User
Anonymous User
Posted 10 years ago

Thank you so much for your explanation, it really help me a lot!

POSTED BY: Anonymous User
Anonymous User
Anonymous User
Posted 10 years ago
POSTED BY: Anonymous User
POSTED BY: Eric Smith
Anonymous User
Anonymous User
Posted 10 years ago
POSTED BY: Anonymous User
POSTED BY: Eric Smith
POSTED BY: Eric Smith
Anonymous User
Anonymous User
Posted 10 years ago
POSTED BY: Anonymous User
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard