# A084962 Fibonaccieth recurrence starting at 6 # Computed using Scala. REPL session transcript after a(4). 0 6 1 8 2 21 3 10946 4 1695216512765707006912636688460460939847003870309508922628952074964839551507932246702558869475815748 4170601553635113401905907399029110700002797308506817311051514274330676300500781749183694624278907584 4284222480507508346716494560703368339751648446746930522234006193293533485374402248297415897454543259 1789827731209030557372256633930683149839626409717124839169824608221506833596891410543329137660619312 0903601697945861945514471877887994857185154165799934822489818762758644456391930222733104608713892459 9311509427252460568924379908119228356481505976716563086312202814067154151545196482976439530571937081 1553817271149380826315230466023026507002229854205437876952547778893000768229990345631410718657870941 3659968056863653918892448893243407287498267367219186008819448765174691702330255652275700355510680375 3743127248972354802770527248287746612321069177803788824237870555679432298570863423665404675962694568 4288864858164686560731839561086029834227227816364375668321265525199377734810991270972560043794159235 0552174844481023079892676683316165071199177414544946973705484778311550808524118410883574020863749299 7207306247286708499409942874104693989372750913222637392366182887235517462836731464791968733111414619 0690996594999860375908597954292079395347372215694053517889302266566670064586452163221750250306444619 0282247896793365368698107194562467628374642681240527079779917533397231472489998620046322372821325486 6256812034573842997505118077925673378404024138374424588598581652394877471466398871932625599862169286 4913270769701218155844595921986391057257689253846347585946379527797730636504822886546148569750291310 2438361701452885037855020005633383121100572341366983806005212425954875056823234454895523776142878208 8008539463401725909235072898016795926740421339799141683922617611820698792848810383119368412380701939 7393332761648298911039072318451469917447711557560674728037013846630363725119342269150068435533855347 5400184859177553029291489412697447302450650481738765308799044735317096361906473580139216243171296120 2819207533231514750569876884901338711673280350278892610526027415283386317679082469437884535799492015 6285102532746081296811489452507281248647347483114535980360513996487400387867943861990334516754379237 2013161434064846335876493427322720159695151529805660626140856032862097770881297257812353 # Scala REPL session transcript (slightly edited) # To reproduce, in your own local Scala REPL, repeat the commands, not the prompts and not "# " # Comments after "//" may also be omitted when reproducing these results # Microsoft Windows [Version 10.0.18363.778] # (c) 2019 Microsoft Corporation. All rights reserved. # C:\Users\AL>scala # Welcome to Scala 2.13.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_251). # Type in expressions for evaluation. Or try :help. # scala> // Definition of fibs from https://www.scala-lang.org/api/current/scala/collection/immutable/LazyList.html # scala> val fibs: LazyList[BigInt] = BigInt(0) #:: BigInt(1) #:: fibs.zip(fibs.tail).map { n => n._1 + n._2 } # fibs: LazyList[BigInt] = LazyList() # scala> fibs(6) # res0: BigInt = 8 # scala> fibs(8) # res1: BigInt = 21 # scala> fibs(21) # res2: BigInt = 10946 # scala> fibs(10946) // It showed more digits than this, but still not the whole thing # res3: BigInt = 1695216512765707... # scala> var fibs10946Str = res3.toString // It showed more characters than this, but still not the whole thing # fibs10946Str: String = 1695216512765707... # scala> import java.io.File # import java.io.File # scala> import java.io.FileWriter # import java.io.FileWriter # scala> // You may use a different file pathname if desired # scala> val path = System.getProperty("user.home") + File.separatorChar + "fibs10946.txt" # path: String = C:\Users\AL\fibs10946.txt # scala> val file = new File(path) # file: java.io.File = C:\Users\AL\fibs10946.txt # scala> file.createNewFile # res4: Boolean = true # scala> val writer = new FileWriter(file) // FileWriter will probably have different number after "@" # writer: java.io.FileWriter = java.io.FileWriter@5f5076f9 # scala> // Start index for java.lang.String.substring() is inclusive, end index is exclusive # scala> for (n <- 0 to 2100 by 100) writer.write(fibs10946Str.substring(n, n + 100) + "\n") # scala> writer.write(fibs10946Str.substring(2200) + "\n") # scala> writer.close # scala> :q # C:\Users\AL> rem Now to check this is in Wolfram Mathematica (not in transcript)