Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Challenges

Post History

50%
+0 −0
Challenges Digit Sum Integer Sequence (working title)

Ruby, 36 bytes Infinite version: n=1;0while n+=p(n).digits.minmax.sum Try this online! (program is interrupted after it reaches the 128KiB limit of output)

posted 3y ago by radarek‭  ·  edited 3y ago by radarek‭

Answer
#3: Post edited by user avatar radarek‭ · 2022-01-16T12:44:56Z (almost 3 years ago)
  • # [Ruby](https://www.ruby-lang.org), 36 bytes
  • Infinite version:
  • ```ruby
  • n=1;0while n+=p(n).digits.minmax.sum
  • ```
  • **[Try this online!](https://ato.pxeger.com/run?1=m72kqDSpcsGCpaUlaboWN1XybA2tDcozMnNSFfK0bQs08jT1UjLTM0uK9XIz83ITK_SKS3MhaqFaYFoB)**
  • <br/>(program is interrupted after it reach the 128KiB limit of output)
  • # [Ruby](https://www.ruby-lang.org), 36 bytes
  • Infinite version:
  • ```ruby
  • n=1;0while n+=p(n).digits.minmax.sum
  • ```
  • **[Try this online!](https://ato.pxeger.com/run?1=m72kqDSpcsGCpaUlaboWN1XybA2tDcozMnNSFfK0bQs08jT1UjLTM0uK9XIz83ITK_SKS3MhaqFaYFoB)**
  • <br/>(program is interrupted after it reaches the 128KiB limit of output)
#2: Post edited by user avatar radarek‭ · 2022-01-16T12:44:06Z (almost 3 years ago)
  • # [Ruby](https://www.ruby-lang.org), 37 bytes
  • Infinite version:
  • ```ruby
  • n=1;n+=p(n).digits.minmax.sum while 1
  • ```
  • **[Try this online!](https://ato.pxeger.com/run?1=m72kqDSpcsGCpaUlaboWN1XzbA2t87RtCzTyNPVSMtMzS4r1cjPzchMr9IpLcxXKMzJzUhUMIYqhemB6AQ)**
  • <br/>(program is interrupted after it reach the 128KiB limit of output)
  • # [Ruby](https://www.ruby-lang.org), 36 bytes
  • Infinite version:
  • ```ruby
  • n=1;0while n+=p(n).digits.minmax.sum
  • ```
  • **[Try this online!](https://ato.pxeger.com/run?1=m72kqDSpcsGCpaUlaboWN1XybA2tDcozMnNSFfK0bQs08jT1UjLTM0uK9XIz83ITK_SKS3MhaqFaYFoB)**
  • <br/>(program is interrupted after it reach the 128KiB limit of output)
#1: Initial revision by user avatar radarek‭ · 2022-01-16T12:42:34Z (almost 3 years ago)
# [Ruby](https://www.ruby-lang.org), 37 bytes

Infinite version:

```ruby
n=1;n+=p(n).digits.minmax.sum while 1
```

**[Try this online!](https://ato.pxeger.com/run?1=m72kqDSpcsGCpaUlaboWN1XzbA2t87RtCzTyNPVSMtMzS4r1cjPzchMr9IpLcxXKMzJzUhUMIYqhemB6AQ)**
<br/>(program is interrupted after it reach the 128KiB limit of output)