[seqfan] Smallest k such that b^^n is not congruent to b^^(n-1) mod k, for various b.

Wayne VanWeerthuizen waynemv at gmail.com
Thu Aug 21 10:23:56 CEST 2014


Hello everyone, I am new to this forum, although I've made a handful of submissions to the OEIS over the last decade. I have no formal training in number theory, although I've picked up bits and pieces of it on my own over the years. 25 years ago I earned a departmental honor in mathematics from my High School, but haven't had any formal mathematics education subsequent to that. On my Facebook and Pinterest pages I have some mathematical art that my own software creates using recursive formulas in 2D. (See facebook.com/waynemv or pinterest.com/waynemv.) That's about all I have to say for introducing myself here.

Anyway, I was recently looking at sequence A027763, since it came up as a related series while I was working on A245970 and A240162. (Note that I am still looking for help with getting A240162, A245970, A245971, and A245973 fixed up and published.)

A027763 is "Smallest k such that 2^^n is not congruent to 2^^(n-1) mod k, where 2^^n denotes the power tower 2^2^...^2 (in which 2 appears n times)." For the sake of this discussion, I'll call A027763 the b=2 sequence. It starts with: 3, 5, 11, 23, 47, 283, 719, 1439, 2879, ...

I was wondering what would happen if the 2 was replaced with a 3 to get a new sequence, which I'll call the b=3 sequence. It would give the "smallest k such that b^^n is not congruent to b^^(n-1) mod k, where b=3 and b^^n denotes the power tower b^b^...^b (in which b appears n times)."

After running some tests, what fascinates me is that with the exception of how the sequences start, the b=2 sequence and the b=3 sequence appear to be the same! (Although I do not yet know how to formally prove that they won't eventually diverge.) The b=3 sequence begins: 5, 11, 23, 47, 283, 719, ...

Furthermore, the initial terms of the b=4 sequence are exactly the same as the b=3 sequence. I don't know if they eventually diverge. Likewise, the b=7 sequence also appears to be exactly the same as the b=3 and b=4 sequences.

Such is not the case for all b, though. Using b=5 gives a different sequence which begins 7, 19, 47, 243, 719, ...

Using b=6 also gives a different sequence, which begins 4, 13, 47, 107, 643, 1439, 2879, ...

Does anyone have any further insights about these sequences?

I am thinking it would be good for the b=3 and b=4 sequence to be mentioned as a comment on A027763. Unless it is better for them to have their own entry in the database since their first term is different from A027763. (What do you all think?)

I am thinking it would also be good if the b=5 and b=6 sequences were in the database as their own entries, because they are interesting in their own right, and also so they could be cited as related sequences to A245972 and A245973.

But I am wary of submitting these myself, since I don't know how to prove enough about them, and I've already gotten in over my head with A245971 and A245973. (The already published sequences A245972 and A245974 were easier for me to deal with since their bases are prime making it was simple to adapt the formula and the Maple program Robert Israel suggested for A240162.)

-- Wayne VanWeerthuizen

P.S. On a final note, I wish I had a faster, or more certainly correct, Sage function for calculating b^^k mod n. (I don't have access to Mathematica or Maple.) The Sage function I have is a bit slow, and while it seems to be accurate, I can't prove it doesn't have any calculation bugs.  The code I am using is:

#Adapted from http://math.stackexchange.com/questions/630134/calculating-an-pmod-m-in-the-general-case?rq=1
def tower_mod(b,i,m):

    if ((b%m)==0): return 0
    if ((i==0)): return 1%m

    if ((i==1)): return b%m

    if ((i==2)): return power_mod(b,b,m)

    if ((b==2) & (i==3) & (m>16)): return 16

    if ((b==2) & (i==4) & (m>65536)): return 65536

    if ((b==3) & (i==3) & (m>7625597484987)): return 7625597484987

    log2p=0

    n=euler_phi(m)

    if (n+1<m): log2p=floor(log(m)/log(2))

    rz = tower_mod(b,i-1,n)

    while ((log2p>0) & (rz<log2p)): rz=rz+n
    return power_mod(b,rz,m)





More information about the SeqFan mailing list