[seqfan] Re: Resurrect A090566?

David Wilson davidwwilson at comcast.net
Sun Nov 22 18:43:22 CET 2015


RGW:

I think your method for computing A090566 is close, but not quite right.

I use the following algorithm to compute a(n+1) from a(n):

---------------------------------------------------
Let x = a(n)
Let d = number of digits in x.
Let p = x'x = x concatenated with x.
Let q = (floor(sqrt(p)) + 1)^2 = smallest square >= p.
If (q has 2d digits)
	a(n+1) = last d digits of q.
else
	Let p = x'(10^d) = x concatenated with 10^d.
	Let q =  (floor(sqrt(p)) + 1)^2 = smallest square >= p.
	a(n+1) = last d+1 digits of q.
---------------------------------------------------

Not being fluent in math power tools, I program mostly in Visual C++ which has 64-bit arithmetic. To get arbitrary arithmetic, I finally bit the bullet and installed the Boost multiprecision package.  Using this, I generated a 1000-element b-file for A090566, at https://oeis.org/A090566/b090566.txt. It should be linked from the sequence once approved.

At any rate, our sequences (your previous post and my b-file) agree up to a(29) = 5912802055698972761, which is encouraging.
However, they differ starting at a(30) where I have 49347575206293434209 and you have 106427200809594982400.
I believe my valid is correct, you may want to verify this and review your algorithm.





More information about the SeqFan mailing list