Hello
Math-Fun & SeqFan,
WARNING!
This
sequence is *not* for OEIS mathematicians!
- it is base-dependent!
- it has black spots on its shirt!
- it is badly defined (in pidgin-English)!
- it is computed by hand...
(I
would recommend it only for drunken ophthalmologists.)
...
Now proceed to 1-click reading © at
your own risks!
-------------------------------------------------------
1,12,35,94,135,186,248,331,344,387,461,475,530,535,590,595,651,667,744,791,809,908,997,1068,1149,1240,1241,1252,...
The
difference between a(n) and a(n-1) is always a 2-digit
figure -- which is reproduced to the left and right of the separating comma:
Sequence: 1, 12, 35, 94, 135, 186, 248, 331,
344, 387, 461, 475, 530, 535, ...
Differences: 11 23
59 41 51
62 83 13
43 74 14
55 05 ...
You
will agree that “05” is not the common way to represent a difference of five
units (in yellow)... Well, so it is here!
Could
someone check if the sequence grows infinitely?
[If you
start the sequence with 3 instead of 1 you’ll get blocked very quickly: 3,36 -- END.]
[Self-blocking
integers are: 18,27,36,45,54,63,72 and 81]
I
could trace only four chains leading to such dead-ends:
3,36 END
31,45 END
15,72 END
43,81 END.
---------------------------------------------------------
I’ve
examined too a few sequences showing the |absolute difference| between a(n) and a(n-1).
I
had thus more choices for a(n+1). So I decided to
build a sequence with differences < 100 and differences > 9 (in
order to avoid leading zeros). I wanted also the sequence to be kept as low as
possible -- and not self-blocking -- and not self-looping either...
Well,
I’m not sure all those criteria are compatible between them and define properly
sequences like this one:
1,12,35,94,135,78,159,251,239,148,62,91,74,115,166,105,156,88,4,48,129,221,209,118,199...
Anyway,
this was great fun to investigate!
Best,
É.
---------------------------------------------------------
The
above message was posted by me on rec.puzzles as well. I got this answer from “The Qurqirish
Dragon” almost immediately:
I noticed one problem with the rule:
Take the sequence starting with 2:
2, (+22) 24, (+47) 71, ?
Is the next value 89 or 90? Both follow the given
rule:
2, (+22) 24, (+47) 71, (+18) 89, (+91) 180, ...
2, (+22) 24, (+47) 71, (+19) 90, (+09) 99, (+91) 190, ...
This problem will happen whenever a given addition
works resulting in a number consisting of all 9s (except for the first digit,
which must be less than 9).
I
got then the same remark from Nicolas Graner, a friend of mine I had written too:
Que fais-tu si tu rencontres 14, 33, 52 ou 71 qui ont deux
successeurs
possibles ?
[What do you do with 14, 33, 52 or 71 which have two
possible successors?]
To
both I wrote:
Well
done! I overlooked that possibility -- please keep the sequence as low as
possible!
Then
I got this from Zak Seidov
-- another friend:
For checking purposes I give first and 10th hundreds
terms of seq:
1,12,35,94,135,186,248,331,344,387,461,475,530,535,590,595,651,667,744,791,809,908,997,
1068,1149,1240,1241,1252,1273,1304,1345,1396,1457,1528,1609,1700,1701,1712,1733,1764,
1805,1856,1917,1988,2070,2072,2094,2136,2198,2280,2282,2304,2346,2408,2490,2492,2514,
2556,2618,2700,2702,2724,2766,2828,2910,2912,2934,2976,3039,3132,3155,3208,3291,3304,
3347,3420,3423,3456,3519,3612,3635,3688,3771,3784,3827,3900,3903,3936,3999,4093,4127,
4201,4215,4269,4363,4397,4471,4485,4539,4633,
<...>
44303,44337,44411,44425,44479,44573,44607,44681,44695,44749,44843,44877,44951,44965,
45019,45113,45147,45221,45235,45289,45383,45417,45491,45505,45559,45653,45687,45761,
45775,45829,45923,45957,46031,46045,46099,46193,46227,46301,46315,46369,46463,46497,
46571,46585,46639,46733,46767,46841,46855,46909,47003,47037,47111,47125,47179,47273,
47307,47381,47395,47449,47543,47577,47651,47665,47719,47813,47847,47921,47935,47989,
48083,48117,48191,48205,48259,48353,48387,48461,48475,48529,48623,48657,48731,48745,
48799,48893,48927,49001,49015,49069,49163,49197,49271,49285,49339,49433,49467,49541,
49555,49609,
Zak

Then
I got this, from Edwin Clark:
Eric,
If I didn't make a mistake in my Maple program:
The last term in your sequence --call it a(n) is
a(2137453)=99999945;
---but there is no next term.
Best wishes,
Edwin
Waow! How quick, Edwin!
Zak answered him (on SeqFan):
Edwin,
This dirty code
a=49703;c=1001;Do[ida=a+10Mod[a,10];Do[b=ida+i;If[i==IntegerDigits[b][[1]],a=b;c++;Break[],If[i9,Print[a];Goto[en]]],{i,0,9}],{10000000}];Label[en];Print[{c,a,b,"end!"}]
99999945
{2137453,99999945,100000004,end!}
confirms your great result!
Ed Murphy sent to rec.puzzles a
message about “blocked sequences”:
a(1) is chosen arbitrarily.
a(n+1) can be any number satisfying the following conditions:
1) d = a(n+1)-a(n) < 100
2) a(n) mod 10 = floor(d/10)
3) d mod 10 = floor(a(n+1)/10^floor(log10(a(n+1))))
In other words, the difference between a(n) and a(n+1)
is a two-digit number that starts with the same digit as the last digit of a(n)
(or is < 10 if a(n) ends in 0), and ends with the same digit as the first
digit of a(n+1).
A given number may have 0, 1, or >1 candidate
successors.
Sample chain:
1, 12, 35,
94, 135, 186, 248, 331, 344, 387, 461, 475, 530, 535, 590
11 23 59
41 51 62
83 13 43
74 14 55
5 55
Sample chains that become blocked:
3, 36
31, 45
15, 72
43, 81
Which choices for a(1) result
in a block? Here's a first stab:
10 for s =
1 to 100
20 dim c[100]; c[1] = s, cc = 1
30 for i = 1 to 100000
40 dim nc[100]; np = 0
50 for ci = 1 to cc
60 for d
= mod(c[ci],10)*10+1 to
mod(c[ci],10)*10+9
70 d$ =
str(d),
n$ = str(c[ci]+d)
80 if mid(d$,-1,1) = mid(n$,1,1) then np
+= 1, nc[np] = c[ci]+d
90 next d
100 next ci
110 if np = 0 then print s, " blocks
on iteration ", i; break
120 c{all} = nc{all}, cc = np
130 next i
140 next s
3 blocks on iteration 2
7 blocks on iteration 15
15 blocks on iteration 2
18 blocks on iteration 1
19 blocks on iteration 21482
21 blocks on iteration 2074
25 blocks on iteration 193
27 blocks on iteration 1
28 blocks on iteration 197
31 blocks on iteration 2
34 blocks on iteration 2073
36 blocks on iteration 1
37 blocks on iteration 196
39 blocks on iteration 20
41 blocks on iteration 19
42 blocks on iteration 1981
43 blocks on iteration 2
45 blocks on iteration 1
49 blocks on iteration 193
53 blocks on iteration 21
54 blocks on iteration 1
56 blocks on iteration 18
60 blocks on iteration 204
63 blocks on iteration 1
65 blocks on iteration 2100
66 blocks on iteration 203
68 blocks on iteration 1980
72 blocks on iteration 1
74 blocks on iteration 20
75 blocks on iteration 2136
81 blocks on iteration 1
82 blocks on iteration 2072
83 blocks on iteration 192
85 blocks on iteration 14
86 blocks on iteration 1983
90 blocks on iteration 21
92 blocks on iteration 20
98 blocks on iteration 205
99 blocks on iteration 20
Alas, Qurqirish Dragon
is wrong; reaching a three-digit sum does not guarantee that the sequence can
be extended indefinitely.
Example:
7, 85, 136, 197, 269, 362, 385, 439, 534, 579, 675,
732, 759, 857, 936
Notice how the number of iterations before a block
clump around 2, 20, 200, 2000, 20000.
Look at that sequence starting with 7:
From 136 to 936, the differences increase roughly linearly within the
11-99 range, averaging somewhere around 50; the amount of increase is
approximately 1000, so the number of increases is approximately 1000/50 =
20. The sequences that block after
approximately 200 iterations are probably hitting similar tar pits at 9xxx
-> 1xxxx, and so forth.
ObPuzzle: What is the largest number of
choices we can have at any iteration?
IOW, how large do the C and NC arrays need to be to guarantee they won't
overflow? Adding the following lines:
125 if m < np then m = np
150 print m
indicates that the maximum number this program actually encounters within 100
iterations is 4, within 1,000 is 5, and within 100,000 is 6.
What if d = abs(a(n+1)+a(n)),
i.e. the sequence is not necessarily monotonically increasing? Which choices for a(1)
result in a block? Which choices result in a loop?
Sample sequence:
1, 12, 35,
94, 135, 78, 159, 251, 239, 148, 62, 91, 74, 115, 166,
105, 156, 88,
4, 48, 129, 221, 209, 118, 199
What if d must be > 10? Adding the following line:
55 if
mod(c[ci],10) = 0 then
continue
indicates that only a few numbers survive to the 20-iteration hump, and none of
them get very far past it:
18 -> 5, 11, 17, 23, 25, 38, 55, 58, 61, 65, 75,
76, 78, 83, 86, 96
19 -> 5, 11, 17, 23, 25, 38, 55, 58, 61, 65,
75, 78, 96
20 -> 5, 11, 17, 23, 58, 61, 78, 96
21 -> 5, 11, 17, 23, 61, 96
22 -> 5, 11, 17
23 -> nothing
What
about bases other than 10?
Indeed,
Ed!
End
of the story -- Zak and Neil have turned this into an OEIS sequence: A121805
Thanks
to all contributors,
É.
---------------------------------------------------------
A
year later (dec. 12th, 2007) David Wilson posted this on Seq-Fans:
Every positive integer n has at most one comma sequence predecessor p(n),
that is, a number which
may precede it in a comma sequence. p(n) is
defined for all
positive integers except
for the 50 integers in the
following set
S
= {
1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
13, 14, 15, 16, 17, 18, 19, 20, 21, 25,
26, 27, 28, 29, 30, 31, 32, 37, 38, 39,
40, 41, 42, 43, 49, 50, 51, 52, 53, 54,
62, 63, 64, 65, 74, 75, 76, 86, 87, 98
}
p(n) is undefined for n in S, for all other
n in N, p(n) < n.
Starting with any
positive integer n, we can iterate p on n until we
reach a unique element a(n) in S, called the ancestor of n.
Going forward, most positive integers n have a unique successor n.
However, there are a smattering of integers that have no successor,
specifically, the integers in the set
T
= { (10^x + 9y) - 100 : x >= 2 and 2 <= y <=
9 }
That is
T
= {
18, 27, 36, 45, 54, 63, 72, 81,
918, 927, 936, 945, 954, 963, 972, 981,
9918, 9927, 9936, 9945, 9954, 9963, 9972, 9981,
...
}
If a comma sequence
reaches an element of T,
the sequence ends there.
There is also a sparse
set of integers that have two successors, these
form the strangely similar set
B
= { (10^x + 9)y - 100 ; x >= 2 and 2 <= y <=
9 }
or
B
= {
118, 227, 336, 445, 554, 663, 772, 881,
1918, 2927, 3936, 4945, 5954, 6963, 7972, 8981,
19918, 29927, 39936, 49945, 59954, 69963, 79972, 89981,
...
}
(10^x + 9)y - 100
has the two successors
(10^x)y - 1 and (10^x)y. No
positive integer has more than two successors.
If a comma sequence
reaches an element of B, it is possible to continue
the sequence in two ways from
that element.
You will notice that comma sequence terminating and branching elements
all occur just
before (within 100 of) an
initial digit change. On intervals
where the initial
digit of its elements remains constant, however, a
comma
sequence behaves very nicely,
with periodic first differences. This allows
one to do some modular magic to skip over these intervals in constant time,
which allows us to quickly compute a(n) for very large n.
Using this knowledge,
I wrote a program to compute
m(n), the largest
possible element in a comma sequence starting with n, for n in S.
It turns
out that there are infinite
comma sequences starting with 20, a comma
sequence with any other
start value in S terminates
at or before 10^365-82.
n m(n)
1 10^25-28
2 10^16-82
3 10^2-64
4 10^7-55
5 10^16-64
6 10^42-64
7 10^3-64
8 10^13-28
9 10^24-19
10 10^13-19
13 10^87-37
14 10^11-82
15 10^2-28
16 10^14-55
17 10^54-55
18 10^2-82
19 10^6-19
20 Infinity
21 10^5-19
25 10^4-37
26 10^7-28
27 10^2-73
28 10^4-73