mastodon.zunda.ninja is one of the many independent Mastodon servers you can use to participate in the fediverse.
Zundon is a single user instance as home of @zundan as well as a test bed for changes of the code.

Administered by:

Server stats:

1
active users

20221220が素数になる基数を探してがんばろう←

おきらくごくらくにやったらアルファベットが足りんかった

> 3.upto(100) do |b| if '20221220'.to_i(b).prime? then puts b end
end
in `to_i': invalid radix 37 (ArgumentError)

zunda

考えてみたら最小桁がゼロならかならず基数で割り切れるのじゃったw

ハワイ時間ならがんばれた

$ cat prime.rb
#!/usr/bin/ruby
require 'prime'

today = '20221219'
a = today.chars.map{_1.to_i}.reverse
b = a.max + 1
while b < 100
x = 0
a.each_with_index{|n,i| x += n*b**i}
if x.prime?
puts "#{today}は基数#{b}で素数なのでがんばろう"
break
end
b += 1
end
$ ruby prime.rb
20221219は基数11で素数なのでがんばろう

@zundan いや、13進数とかもありますよ!

@zundan にしても、それで割れて1より大きくなるからだめか😭

@tadd 整数むずかしー!