This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A135500 #12 Sep 29 2024 11:58:38 %S A135500 0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0, %T A135500 0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1, %U A135500 1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0 %N A135500 Generating function for Viswanath's constant, using the golden string. %C A135500 For each bit of the golden string that is a 1, write seven consecutive bits and for each 0 of the golden string write eight consecutive bits. %C A135500 Alternate between 0 and 1. Exclude the first seven bits since we are based at zero, just like the golden string. Heads = 1, Tails = 0. %H A135500 S. Findley, <a href="http://groups.myspace.com/ViswanathsCurve">Viswanath's curve</a> %F A135500 Each power of Viswanath's constant (1.131988248...) And V^3 has a corresponding coin flip. Simply take the absolute values of the two possible(+Heads or -Tails) outcomes and choose the flip closest to the value of the power. %e A135500 Bit 1 of the golden string is a 1, so bits 8-14(seven consecutive) are the same. Bit 2 of the golden string is 0, so bits 15-22(eight consecutive) are the same. Odd bits of the golden string mean to write 1 and even bits of the golden string mean to write 0. %o A135500 (Visual Basic) %o A135500 'Visual Basic .NET %o A135500 Private Structure VISINFO %o A135500 Public dec, str, terms As String %o A135500 End Structure %o A135500 Private Function InputDecimal(ByVal vConstant As String) As VISINFO %o A135500 On Error Resume Next %o A135500 Dim i, q As Int32, a, b, c, n, z, v, sum As Decimal, gBit As String %o A135500 gBit = "" : a = 0 : b = 1 : c = 0 : n = CDec(CDec(vConstant) ^ 3) : z = n %o A135500 InputDecimal.dec = "" : InputDecimal.terms = "" : InputDecimal.str = "" %o A135500 For i = 1 To CInt(txtExponent.Text) %o A135500 If Abs(Abs(a + b) - n) < Abs(Abs(a - b) - n) Then %o A135500 c = a + b : gBit = "1" %o A135500 Else %o A135500 c = a - b : gBit = "0" %o A135500 End If %o A135500 a = b : b = c %o A135500 v = CDec(System.Math.Abs(c) ^ (1 / i)) %o A135500 sum += v : q += 1 %o A135500 InputDecimal.terms &= gBit & " " & CStr(i) & " " & CStr(System.Math.Round(n)) & " " & c.ToString & vbCrLf %o A135500 InputDecimal.str &= gBit %o A135500 InputDecimal.dec = ((sum / q) ^ (1 / 3)).ToString %o A135500 n = n * z %o A135500 Next %o A135500 End Function %Y A135500 Cf. A036299, A078416, A115064. %K A135500 easy,nonn,uned %O A135500 0,1 %A A135500 _Shane Findley_, Feb 19 2008