fib_floor.sf 712 B

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/ruby
  2. # https://oeis.org/draft/A307736
  3. # Integers k such that ceiling(Lucas(k)/log(k)) is prime.
  4. # 12286, 14334
  5. # https://oeis.org/draft/A307737
  6. # Integers k such that ceiling(Fibonacci(k)/log(k)) is prime.
  7. # 5762, 8430, 8814,
  8. # https://oeis.org/draft/A307729
  9. # Integers k such that floor(Fibonacci(k)/log(k)) is prime.
  10. # https://oeis.org/draft/A307728
  11. # Integers k such that floor(Lucas(k) / log(k)) is prime.
  12. # Found: 33399
  13. func f(n) {
  14. var l = fib(n)
  15. local Num!PREC = 4*(l.len+10)
  16. floor(l / log(n)).int
  17. }
  18. STDOUT.autoflush(1)
  19. for k in (34823..1e6) {
  20. say "Testing: #{k}"
  21. if (f(k).is_prob_prime) {
  22. say "Found: #{k}"
  23. die "new term: #{k}" if (k > 33399)
  24. }
  25. }