# [seqfan] Re: Numbers n such that the decimal representation of n is contained as substring in that of the n-th pentagonal number.

Douglas McNeil mcneil at hku.hk
Tue Jul 27 14:17:34 CEST 2010

```On Tue, Jul 27, 2010 at 6:19 PM, Richard Mathar
<mathar at strw.leidenuniv.nl> wrote:
> There is a standard wording problem here: does "substring" mean
> i) contiguous and/or ii) ordered substring? This comes up in particular
> since all examples agree already with the narrow interpretation.

Ah, good point: I for one always take contiguity as read when
"substring" is used unless otherwise instructed.  But I think it's a
language issue, not a programming issue (I'd have done exactly the
same thing by hand.)  In this case we can probably take it that a
contiguous ordered substring is meant because (ISTM) none of the other
interpretations agree with the terms presented.  Might as well resolve
ambiguities in the sequence's favour.

Assuming no mistakes on my part, we have:

orig.: [0,1,5,7,25,67,482]
contiguous and ordered: [0, 1, 5, 7, 25, 67, 482, 551, 625, 667]
ordered but not necessarily contiguous: [0, 1, 5, 7, 25, 59, 65, 67,
81, 145, 284, 401, 481, 482, 551, 620, 625, 640, 656, 659, 665, 667,
670, 720, 965]
contiguous but not necessarily ordered: [0, 1, 5, 7, 12, 25, 67, 78,
263, 274, 284, 323, 401, 478, 482, 551, 625, 667, 723, 878, 894]
neither nec. contig. nor nec. ordered: [0, 1, 5, 7, 12, 25, 59, 65,
67, 78, 81, 106, 107, 120, 121, 145, 180, 236, 263, 274, 284, 314,
323, 372, 401, 402, 407, 412, 420, 478, 481, 482, 541, 545, 548, 551,
568, 570, 578, 620, 625, 640, 656, 657, 659, 665, 667, 670, 678, 704,
720, 723, 742, 753, 789, 794, 798, 850, 851, 878, 894, 920, 921, 925,
929, 940, 957, 964, 965, 984]

Doug

--
Department of Earth Sciences
University of Hong Kong

```