prog.sf 459 B

123456789101112
  1. #!/usr/bin/ruby
  2. # a(n) is the smallest k such that usigma(k) = A002110(n), or 0 if no such k exists.
  3. # https://oeis.org/A291356
  4. # Known terms:
  5. # 1, 0, 5, 18, 164, 1538, 20018, 408404, 7759748, 148728578, 0, 194482899488, 0, 286353189202064, 0, 491911826070793124, 32087786808310197824, 1809656800145141307344, 113734187984879487014048, 0, 0, 27153120399499349433747548978, 0
  6. for k in (1..30) {
  7. print(k.pn_primorial.inverse_usigma.first || 0, ", ")
  8. }