# print my phone number # scottvr # the only the remotely interesting is that for some reason # late one night I noticed that the digits in my phone number # closely resembled the digits in the Fibonacci Sequence. # I wondered if there might be a series in my tn I could represent # with some function. I managed to come up with the recursive # subroutine you see below. Obviously, it took some massaging but # I think it looks cool even if it is mathematically uninteresting. ## # this is a recursive function # as you can see, it generates the fibonacci series # with a slight modification causing it to generate # the digits in my phone number as the first # 10 numbers in the series sub tn { $_[0] >= 6 ? return(tn($_[0]-6) + 6) : $_[0]; $_[0] < 2 ? $_[0] : tn($_[0]-1) + tn($_[0]-2); } # now we print out the digits in their correct order # a,b,c, and d are given values such that # a, b, a-b, c, d, d-c # then i=0, i+=2, i+=2, i+=2 # are the indexes to the digits in the series, # printing my phone number in the proper order $a=4,$b=3; $c=5,$d=6; for($a,$b,$a-$b) { print tn($_); } for($c,$d,$d-$c) { print tn($_); } for(00,02,04,06) { print tn($_); } # (although anyone could look up my tn if they really want it, # I felt compelled to change the values of a,b,c,d # such that running the script as is gives a bogus npanxx.) # this obviously serves no purpose. I just saw an interesting # pattern in my head and had to get it out. :-)