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

Alois Heinz heinz at hs-heilbronn.de
Tue Jul 27 14:33:51 CEST 2010

```I understand that "substring" is contiguous and ordered, whereas
"subsequence"

http://en.wikipedia.org/wiki/Subsequence#Substring_vs._subsequence

Numbers n such that the decimal representation of n is
contained as subsequence in that of the n-th pentagonal number:

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,
1001, 2881, 2937, 3001, 3401, 4001, 4005, 4007, 4042,
4116, 4825, 5480, 5517, 5523, 5632, 5821, 5825, 5880,
5940, 5941, 6116, 6118, 6343, 6398, 6400, 6401, 6540,
6561, 6600, 6601, 6614, 6625, 6635, 6656, 6659, 6665,
6667, 6670, 6720, 6776, 6811, 6825, 7025, 7123, 7161

Richard Mathar schrieb:
> 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.
>
> Is, for example, 342 a substring in 348245 = (34)8(2)45?
> Is 842 a substring of 348245 = 3(4)(8)(2)45? Most people writing programs
> tacitly assume that they may use the simplest interface their
> programming language/library offers, which is the (linear time) algorithm
> that searches only for blocks of correctly oriented substrings
> in the host string.
>
> RJM
>

```