Sequences based on algorithms

Olivier Gerard olivier.gerard at gmail.com
Wed Nov 14 13:32:29 CET 2007


On Nov 13, 2007 10:06 PM, Andrew Plewe <aplewe at sbcglobal.net> wrote:
>
> I wonder; are 4, 10, 14, and 22 the only even integers in the sequence?

Yes. (And don't forget 6 too quickly !)

x/2 will be larger than nextprime( 2 sqrtint(x)), nextprime( 2
sqrtint(x)-1)  or nextprime(2 sqrtint(x)-2) (the three cases giving 2
as the other prime)
at last starting x >= (2 ^2 +1)^2 = 25, the difference between roughly linear.

Also of minor interest: prime balanced numbers in more than one way:

14, 22, 85, 119, 253, 319, 377, 407, 527, 629, 697, 703, 943, 989, \
1081, 1219, 1363, 1537, 1643, 1711, 1769, 1829, 1943, 2183, 2257, \
2479, 2627, 2747, 2881, 2911, 2923, 3053, 3239, 3337, 3397, 3431, \
3713, 3901, 4183, 4187, 4399, 4559, 4717, 4897, 5141, 5251, 5353, \
5429, 5723, 5917, 5959, 6313, 6499, 6731, 6767, 6887, 6901, 7169, \
7171, 7303, 7313, 7373, 7493, 7571, 7597, 7747, 7811, 8023, 8453, \
8509, 8611, 8927, 9017, 9271, 9379

the 3 most versatile under 10000 (with 6 different y) being

5141, 7493 and 8509

thanks to the comparable size of the gaps before their
two prime factors.  With the rarefaction of primes
it is plausible to have even larger records.

And there is a link between the density of twin primes
and the density of balanced numbers in very few ways.



"And there is a link between the density of twin primes and the density of
balanced numbers in very few ways."

That's one of the things I was thinking about that I thought was
interesting. There are hints as well of a nice algorithm for determining the
factors of a "balanced" number quickly, or at least some subset of the
"balanced" numbers.

"you have to construct yourself sqrtint, so you have to choose between
Floor, Round and Ceiling."

As Ray Chandler pointed out to me off-list, the better term would be
"truncate". That's a better match for what sqrtint does -- it returns the
integer part of the square root of n, truncating whatever is after the
decimal. That generally translates to "floor", so doing floor(sqrt(n))
those issues when I submitted the sequence, so hopefully it's clear to
anyone who might run into it.








More information about the SeqFan mailing list