Saturday, October 14, 2017

An eventful week; a grateful me

The younger ex-teen got married last weekend; it was a celebration of great joy—and also relief.

You see, Grandma Bessie (my mom) was planning to visit us, arriving Tuesday night. But rather than going to the airport, she went to the emergency room due to abdominal pain, severe and unrelenting. My mobile phone exploded with text messages. The phrase “aortic <something>” was heard. X-rays and CAT scans were discussed.

They had me at “aortic”; I started checking flights, but didn’t book anything until the medical folks settled on the diagnosis: aortic aneurysm. I clicked “Book this flight” for Alaska 837, SJC→HNL Wednesday morning.

Wednesday

Am I getting old, or was it just the stress, or have the seats gotten harder? Whatever it was, I was hurting by the time we landed. Inga picked me up and we went straight to Queen’s. Dr. Sato came in and advised Mom to get the endovascular aneurysm repair, maybe like the one decribed here on webmd.

As I heard the story, Mom had said she’d consider it; today the surgeon was recommending it. He itemized a bunch of risks, things that might happen during surgery. They’re not frequent, he said, but they do happen. I asked him what he would recommend for his own mother, if she had a similar condition. Surgery.

He told Mom of a past, younger patient of his. He recommended the surgery, she declined, she went home, the aneurysm ruptured, and she died the same day. Mom was sold, and Dr. Sato indicated that he’d try to do the endovascular aneurysm repair Thursday afternoon.

Then an anaesthesiologist came in, describing how the anaesthesia itself had risks (beyond the surgery), including death! My comment was, we don’t have many alternatives here.

Thursday

In the morning we heard the surgery would be at noon! I ran down to the hospital, having spent the night at “home,” and hung around until they shooed me out. I sat in the waiting room for a while, and then sister Donna said I could join her in pre-op. After some confusion, the nurse and I found each other, and she ushered me in to Mom’s area, where it was freezing. I was impressed by the keep-warm technology.

Mom was mightily bored by all this and kept dozing off, or maybe she just closed her eyes. Eventually they said they were really going to do the surgery, and I snapped a pic just as she was about to go to the “OR.” The photo is dated 1:57pm.

I went home for a nap, and Mom was done about 5:20pm. The surgery had gone well, I heard. I eventually figured out how to get to the surgical waiting room in QE Tower. Quite a few folks were there, sister Inga and nieces and nephew; several of them were still heading to California for the wedding.

They let me into the recovery area after a while, and I joined Donna there. Mom would have to lie flat for four hours, the first two with sandbags on her thighs, to discourage reopening of the surgical incisions (pokes, actually). She wasn’t too happy about that.

I held Mom’s hand for the next 3 hours or so, giving her Bible passages or praying or chatting or just sitting. At some point Donna took my parking ticket to a nurses’ station, where they stamped it for me. I would later find out that the afternoon’s parking would be on the house :).

At the 7:00pm shift change, the new nurse asked Mom if she knew where she was.

“Hospital,” she murmured.

“Do you remember the name of the hospital?”

“Queen’s.”

“Do you know what month and year it is?”

“October,” she croaked.

“And do you know remember the year?”

“Seventeen.” It was barely a whisper.

“Who are these people?” the nurse asked, indicating Donna and me.

“I don’t know!” she said. Very funny, Mom! The nurse wasn’t fooled for a moment.

Some other post-op procedures were needed. An X-ray for example. So the X-ray guy showed up after a while and said something about sitting her up. The nurses updated him on the situation; I didn’t have to tackle him.

Around 10pm the nurse moved her to a private room in QE tower. We were about to exit the elevator on the 8th floor when an EMERGENCY indicator lit up, the doors closed, and the elevator expressed back whence we came.

The doors opened to reveal a nurse with a surprised expression; he released the elevator, mumbling something about grabbing another one, and the elevator returned to the 8th floor. Our nurse explained that some ICU patients must be transported without delay immediately after surgery; they cannot wait.

Mom got situated and after a while, Donna suggested I go home. No argument from me on that.

Friday

The next morning, Dr. Sato dropped by Mom’s room to ask how she was doing. Any pain? Mom shook her head no.

He smiled. “See? Told you!”   He also said, “You can go home today as far as I’m concerned.” No medication needed, but Mom should take it easy the next couple of weeks.

I ran “home” so Jana could take me to the airport. (I had already packed my things.)

My return flight was uneventful, but all too long. Again my seat hurt. The lovely Carol picked me up late Friday night.

Saturday

I’d missed Friday afternoon’s rehearsal, but I was assured all I had to do was follow directions—always a challenge for me, but perhaps it would be OK this time.

Several friends of Peter and Sheri spoke at the ceremony; each one added a unique perspective, so that all of us present got glimpses of both bride and groom. I have to tell you that as much as I respected and esteemed Peter before the ceremony, his friends’ comments made me feel even happier to have him in our family. The celebration was intimate and meaningful and and God-honoring.

By the way, my nephew Keith unobtrusively live-streamed the ceremony; Mom and Donna and Jana and Mom’s great-grandchildren all could see it.

As I said at the reception, “It’s hard to be humble when Peter is your son-in-law!” Oh, and we “facetime”d with Mom at the reception. She looked happy.


I am a very grateful man today. I wasn’t quite in a panic Tuesday, but as I said several times, it was a little too exciting. Aortic aneurysms are often fatal; it was fortunate indeed that Mom had a lot of pain so that she would know to go to the hospital. And it was fortunate that the symptoms appeared before she came to California.

And now both my daughters have husbands that make it impossible for me to be humble.

And it’s also really hard to be ungrateful. My cup is full, even as the nest is empty.

Monday, October 09, 2017

Well, that’s weird: Fibonacci edition

About six years ago, I read a puzzle about Fibonacci numbers in CACM and tried to understand the solution, so when I recently saw on quora the question “Is every Fibonacci number divisible by 31 also divisible by 61?” I was interested enough to figure out (to my surprise) that indeed every one is: every 15th Fibonacci number is divisible by 61, but only every 30th is divisible by 31.

This I found unusual and amazing, and I wondered, for what other primes is this true? Naturally I wrote some Python.

#!/usr/bin/python -utt
# vim:et:sw=4

'''
Let f(n) be the nth Fibonacci number (f(0)=0, f(1)=1, f(n)=f(n-1)+f(n-2))
For prime p, let ff(p) be the smallest n such that p|f(n),
e.g. ff(3)=4 because f(4)=3

Now, what primes (p, p2) satisfy p>p2 but ff(p)<ff(p2) and ff(p)|ff(p2)?
'''
import sys

def main(maxx):
    '''
    Get primes up to /maxx/, and the first /maxx/ Fibonacci numbers,
    then check for the criteria described above.
    '''
    plist = prime_list(maxx)
    flist = fib_list(maxx)
    ff = dict()
    for p in plist:
        for n, f in enumerate(flist):
            if f >= p and f % p == 0:
               ff[p] = n        # e.g. since f(4) == 3, ff[3] = 4
               break
        else:
            print "Couldn't find fib which %d divides" % (p)
    # Now ff[p] is idx of 1st fib that p divides
    for idx, p in enumerate(plist):
        f = ff[p]
        for j, p2 in enumerate(plist[:idx]):
            # for p2 < p
            f2 = ff[p2]
            if f2 > f and f2 % f == 0:
                print 'f(%d) = %d and f(%d) = %d' % (p, f, p2, f2)
            
    sys.exit(0)

def prime_list(pmax):
    '''
    Return a list of prime numbers up to pmax (sloppy criterion)
    '''
    # First two nontrivial primes
    plist = [2, 3]
    # Look for further primes by formula p = 6k +/- 1 for some k
    for cseed in range(6, pmax, 6):
        cand1, cand2 = cseed - 1, cseed + 1
        for p in plist[2:]:
            # Zero a cand if another prime p>3 divides it.
            # Need not check p≤3 because of construction.
            if cand1 == cand2:
                # must both be zero
                break
            if cand1 and cand1 % p == 0:
                cand1 = 0
            if cand2 and cand2 % p == 0:
                cand2 = 0
        else:
            append_t(plist, cand1)
            append_t(plist, cand2)
    return plist

def append_t(alist, athing):
    '''
    Helper: append /athing/ to /alist/ but only if /athing/ is "true"
    '''
    if athing:
        alist.append(athing)


def fib_list(fmax):
    '''
    Return a list of the first /fmax/ Fibonacci numbers
    '''
    bak1, cur = 0, 1            # f(0)=0, f(1)=1
    flist = [bak1, cur]
    for n in range(2, fmax):
        bak1, cur = cur, cur + bak1
        flist.append(cur)
    assert flist[5] == 5        #print 'DEBUG:', 5, flist[5]
    #print 'DEBUG:', flist
    return flist

if __name__ == '__main__':
    maxx = 99
    if len(sys.argv) > 1:
        maxx = int(sys.argv[1])
    main(maxx)
Running it produces:
Collins-MacBook-Pro:fib31 collin$ ./pfib.py 
f(61) = 15 and f(31) = 30
f(89) = 11 and f(43) = 44
Collins-MacBook-Pro:fib31 collin$ 
Whoa, really? Every 11th prime is divisible by 89, but only every 44th is divisible by 43? H'm.
f(11)=89, f(22)=17711, f(33)=3524578, f(44)=701408733
Every one of those guys is divisible by 89, but only the last is divisible by 43. How weird is that? And from looking at the pattern of what happens to f(n) mod 89 as n increases, it's clear that indeed every 11th Fibonacci number is divisible by 89, and every 44th is divisible by 43.

If instead of 99 we say 199 or 299, what do we get?

Collins-MacBook-Pro:fib31 collin$ ./pfib.py 199
f(61) = 15 and f(31) = 30
f(89) = 11 and f(43) = 44
f(199) = 22 and f(43) = 44
Collins-MacBook-Pro:fib31 collin$ 
OK, I examined that one, and everything is as it seems. What if we go another 100?
Collins-MacBook-Pro:fib31 collin$ ./pfib.py 299
f(61) = 15 and f(31) = 30
f(89) = 11 and f(43) = 44
f(199) = 22 and f(43) = 44
f(211) = 42 and f(83) = 84
f(211) = 42 and f(167) = 168
f(229) = 114 and f(227) = 228
f(233) = 13 and f(79) = 78
f(233) = 13 and f(103) = 104
f(233) = 13 and f(131) = 130
f(281) = 28 and f(83) = 84
f(281) = 28 and f(167) = 168
f(281) = 28 and f(223) = 224
Collins-MacBook-Pro:fib31 collin$ 
Well, that was fun if not exactly insightful. Why so many from 200–299, compared to the range 1–199? But the upshot is, we could ask a number of other questions, like
  • Is every Fibonacci number that's divisible by 89 or 199 also divisible by 43? (Yes.)
  • Is every Fibonacci number that's divisible by 79 or 103 or 131 also divisible by 233? (Yes.)
and so on. No idea why, but there it is.