viswanath_s_constant_conjecture.sf 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/usr/bin/ruby
  2. # Author: Daniel "Trizen" Șuteu
  3. # Date: 24 February 2018
  4. # https://github.com/trizen
  5. # A new formula for computing Viswanath's constant. (weak conjecture -- incorrect)
  6. # Blandin-Diaz compositional Bernoulli numbers (B^S)_1,n:
  7. # a(0) = 1
  8. # a(n) = -Sum_{k=0..n-1} a(k) / ((n-k+1)!)^2
  9. # Next, we define `t` to be the following sum:
  10. # t = Sum_{k=0..Infinity} 1 / (a(k) * k!)
  11. # From which we extract Viswanath's constant:
  12. # v = (19500 - 3*t)/(10756 - 3*t)
  13. # See also:
  14. # https://oeis.org/A078416
  15. # https://en.wikipedia.org/wiki/Random_Fibonacci_sequence
  16. # https://www.wolframalpha.com/input/?i=Viswanath%27s+constant
  17. # https://www.wolframalpha.com/input/?i=18497.440650652720515613516713415750667794722534171
  18. func a((0)) { 1 }
  19. func a(n) is cached {
  20. -sum(^n, {|k| a(k) / (n - k + 1)!**2 })
  21. }
  22. var t = sum(0..200, {|k|
  23. 1 / (a(k) * k!)
  24. })
  25. var v = (19500 - 3*t)/(10756 - 3*t)
  26. say "Viswanath's constant is: #{v} (conjectured)"
  27. __END__
  28. Viswanath's constant is: 1.13198824879430090510505642117075909739291590469 (conjectured)