[seqfan] A169858 corrected, extended
hv at crypt.org
hv at crypt.org
Fri Jun 4 14:10:54 CEST 2010
Earlier I wrote:
:hv at crypt.org wrote:
::I started looking at this, but didn't realise until after I had written
::the program that I had misinterpreted the definition - I was looking only
::at the left-anchored substrings, not at all substrings, so what I have
::actually calculated is the sequence:
:: Smallest integer k such that k or one of its left substrings (regarded as an
:: integer) is divisible by any integer from {1,2,...,n}
::Or more formally:
:: a(n) = min m: forall d in {1..n}: exists k in {0..log_10(m)}:
:: d | floor(m / 10^k)
::
::If I've calculated correctly, initial values of this sequence are:
::a(1..10): 1, 2, 6, 12, 45, 60, 245, 245, 504, 504,
::a(11..20): 5049, 5049, 10296, 11760, 11760, 11760, 56160, 56160, 198016, 198016,
::a(21..30): 781286, 1323008, 2340849, 6240366, 13442580, 13442580, 22680329,
:: 25380966, 75432065, 75432065,
::a(31..40): 180092645, 319800096, 319800096, 800640126, 2046241575, 2201169600,
:: 3780487275, 5250966084, 5250966084, 6832425609
:
:It has been drawn to my attention that at least a(21) as given here is
:clearly wrong. I'll work on fixing that and double-checking the other
:results.
I found that the errors occurred because in certain cases my program's
cached prefixes could get out of sync. This caused it to emit wrong values
for a(21, 27, 28, 35). I fixed that, and implemented a different algorithm
to cross-check. Documented C code (using GMP v5) for the new algorithm is
available at <http://crypt.org/hv/puzzle/A169858-0.03.tar.bz2>.
I'm not sure if an external reference to a program should be %H or %o,
I guessed %H. I'm also not sure at what point a long %U line should instead
become a b-file, but (in case it is relevant) I'm not planning to calculate
more values of this sequence.
%I A169858
%S A169858 1,2,6,12,45,60,245,245,504,504,5049,5049,10296,11760,11760,11760,
%T A169858 56160,56160,198016,198016,1008159,1323008,2340849,6240366,13442580,
%U A169858 13442580,37536408,37536408,75432065,75432065,180092645,319800096,319800096,800640126,2201169600,2201169600,3780487275,5250966084,5250966084,6832425609,36960308625,36960308625,62244072512,62244072512,62244072512,62244072512,372960042489,372960042489
%N A169858 Smallest integer k such that k or one of its left substrings (or prefixes, regarded as an integer) is divisible by any integer from {1,2,...,n}.
%C A169858 More formally: a(n) = min m: forall d in {1..n}: exists k in {0..log_10(m)}: d | floor(m / 10^k)
%Y A169858 Cf. A177834, A175516.
%H A169858 Hugo van der Sanden <a href="http://crypt.org/hv/puzzle/A169858-0.03.tar.bz2">A169858-0.03.tar.bz2</a>: C source code to calculate terms.
%K A169858 nonn,base,new
%O A169858 1,2
%A A169858 Hugo van der Sanden (hv(AT)crypt.org), Jun 01 2010
%E A169858 Corrected and extended Hugo van der Sanden, Jun 04 2010 (errors reported by Zak Seidov).
Hugo
More information about the SeqFan
mailing list