cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-4 of 4 results.

A230288 Sum of two digits touching a comma = difference between the two terms separated by that comma; start with a(0)=0, a(1)=5. If there is a choice, choose the smaller value for a(n).

Original entry on oeis.org

0, 5, 11, 13, 17, 26, 35, 44, 53, 62, 71, 79, 97, 105, 111, 113, 117, 125, 131, 133, 137, 145, 151, 153, 157, 165, 171, 173, 177, 185, 191, 193, 197, 206, 214, 220, 222, 226, 234, 240, 242, 246, 254, 260, 262, 266, 274, 280, 282, 286, 294, 301
Offset: 0

Views

Author

N. J. A. Sloane, Oct 17 2013

Keywords

Comments

Comment from Jack Brennen: This sequence stops after 123 terms. The 123rd term is 989 which has no possible successor. It looks like many low starting points lead to 989 and halt there. The smallest starting point which goes beyond that seems to be the number 396 (which has no possible predecessor). The sequence beginning with 396 goes on for quite some distance. I traced it up to values in excess of 20 million (over 3 million terms).
Comment from Lars Blomberg: (Start)
1. As for 396, I notice that the first differences of the sequence are: 396,10,10,10,10,10,10,10,10,10,10,11,12,14,8,6,12,14,8,6,12,15, 10,10,10,10,10,10,10,10,11,12,14,8,16,12,14,8,17,14,8,16,12,14, 8,16,13,16,12,14,18,16,12,(6,2,4,8) ... repeated indefinitely, which suggests that the sequence started with 396 is infinite.
2. Numbers with no successors, empirically for number of digits n=2,3,4:
86 986 9986
87 987 9987
88 988 9988
89 989 9989
91 991 9991
92 992 9992
93 993 9993
94 994 9994
It seems that the rule is that numbers of the form 10^n - s, s=14, 13, 12, 11, 9, 8, 7, 6 have no successors. Can this be proved? It suggests that once an iteration has come into the millions, the chance of hitting a no-successor becomes very small. (End)
Comment from Nicolas Graner (Start):
Here is an argument to try to prove that the sequence starting with 396 is infinite.
Starting from 1001 (which is reached from 396), you eventually reach 9995. The next number is 10001, which eventually yields 99995, followed by 100001.
More generally, take 1x001, where x is any sequence of digits. It will reproduce the sequence from 1001 to 1995, up to 1x995. This is followed by 1y001, with y = X+1. This repeats until x becomes all 9's, at which point the first digit will change: 199..995 -> 200..002.
Now we get numbers of the form 2x002, which reproduce the sequence from 2002 to 2994 while x increases, until it reaches all 9's and the first digit becomes 3.
You can repeat this reasoning with each value of the first digit. There are some subtleties because, when the first digit changes, the last one is not always the same. But since the sequence is very "robust" (as evidenced by forking sequences, which reunite pretty quickly), variations in the last digit have no effect beyond a couple of terms.
So starting with 100*001, we are bound to get eventually to 999*995, which is followed with 1000*001 (with one more digit). Which shows that the sequence is almost certainly infinite. (End)
See A230450 for the (probably) infinite sequence starting with 396. See A230452 for the numbers not ending in 989 (as does the present sequence). See A230453 for the number of terms in the comma sum sequence depending on the starting value. - M. F. Hasler, Oct 19 2013

Examples

			Consider the first comma: Its closest digits are 0 and 5. Add 0 to 5: The sum (5) is the difference between 0 and 5.
Consider the second comma: Its closest digits are 5 and 1. Add 5 to 1: The sum (6) is the difference between 5 and 11.
Etc.
		

References

  • Eric Angelini and others, Postings to Sequence Fans Mailing List, Oct 11 2011.

Crossrefs

Programs

  • PARI
    print_A230288(s=5,nMax=9e9,verbose=1)={print1(s);for(i=1,nMax, for(d=1,18,digits(s+d)[1]+s%10==d&&print1(","s+=d)+next(2));verbose && print("\nSequence stops after the term a("i")="s);return([i,s]))} \\ Starting with 0 yields the 2-term sequence (0,1); start with 5 to get the sequence 0,5,... without the initial zero, M. F. Hasler, Oct 19 2013
    
  • PARI
    A230288_vec(a=[0,5],nMax=9e9)={ for(i=1,nMax, for(d=1,18, d==a[#a]%10+digits(a[#a]+d)[1] && (a=concat(a,a[#a]+d)) && next(2)); break);a} \\ M. F. Hasler, Oct 19 2013
    
  • Python
    from itertools import count, islice
    def A230288gen(start=[0, 5]): # generator of terms
        yield from start
        an = start[-1]
        for n in count(len(start)+1):
            lsd = an%10; b = an+lsd
            an = next((k for k in range(b+1, b+20) if k==b+int(str(k)[0])), 0)
            if not an: return
            yield an
    print(list(islice(A230288gen(), 123))) # Michael S. Branicky, Nov 03 2024

Formula

a(n+1) - a(n) = lsd(a(n)) + msd(a(n+1)), where
lsd(a) = "a mod 10" is the least significant (leftmost), and msd(a) = floor(a/10^floor(log[10](a))) the most significant (rightmost) digit. - M. F. Hasler, Oct 19 2013

Extensions

More terms (full sequence) and minor edits from M. F. Hasler, Oct 19 2013

A230452 Starting values for which the "comma sum" sequence (cf. A230288) does not end in 989.

Original entry on oeis.org

0, 1, 2, 3, 4, 47, 49, 52, 54, 59, 64, 65, 67, 69, 70, 72, 74, 75, 76, 77, 80, 81, 82, 86, 87, 88, 89, 91, 92, 93, 94, 396, 398, 401, 403, 405, 406, 409, 410, 411, 414, 416, 417, 421, 422, 426, 428, 431, 433, 435, 436, 439, 440, 441, 444, 446, 447
Offset: 0

Views

Author

M. F. Hasler, Oct 19 2013

Keywords

Comments

According to the general rules, the starting value 0 ends in 1, therefore the value 0 has been included here. However, we list it with index 0 since the original sequence A230288 had been *defined* to start 0,5,11... (and ends in 989), so some might consider that 0 should not be here.
This sequence obviously includes all integers beyond 989.

Crossrefs

Programs

  • PARI
    for(n=0,999,vecmax(A230288_vec([n],150))==989||print1(n","))

A230453 Number of terms in the "comma sum" sequence (cf. A230288) starting with n, or 0 if it is infinite.

Original entry on oeis.org

2, 1, 1, 1, 1, 122, 121, 121, 120, 120, 122, 121, 121, 120, 120, 120, 120, 119, 118, 119, 120, 120, 119, 118, 119, 118, 118, 117, 117, 117, 118, 118, 117, 117, 117, 117, 116, 116, 116, 116, 117, 116, 116, 116, 116, 115, 115, 4, 115, 4, 115, 115, 4, 115, 4, 114, 114, 114, 114, 3, 114, 114, 114, 114, 3, 3, 113, 3, 113, 2, 3, 113, 3, 113
Offset: 0

Views

Author

M. F. Hasler, Oct 19 2013

Keywords

Comments

A "comma sum" sequence is such that a(n+1)-a(n) = rightmost digit of a(n) + leftmost digit of a(n+1), taking usually the smallest possible solution.
The value a(0)=2 corresponds to the sequence (0,1), not to sequence A230288 starting by definition with 0,5,....
a(n)>0 for all n<396. See A230450 for the sequence starting with 396.

Crossrefs

Programs

  • PARI
    for(n=0,196,print1(#A230288_list([n],150),",")) \\ The second argument (nMax) is useful only for n>= 396. If this value (here 150) is printed, this most probably means that the sequence is infinite, a(n)=0.
    
  • Python
    # uses A230288gen() in A230288
    def a(n): return len(list(A230288gen(start=[n])))
    print([a(n) for n in range(100)]) # Michael S. Branicky, Nov 03 2024

A334829 The sum a(n) + a(n+1) is visible around the comma that follows a(n+1). See the Comments and Example sections for details.

Original entry on oeis.org

1, 11, 23, 46, 91, 374, 6506, 8801, 53076, 18777, 18533, 73109, 16428, 95371, 117992, 133632, 516246, 4987805, 50405105, 539291005, 896961101, 4362521065, 2594821666, 9573427311, 21682489773, 12559170843, 42416606165, 49757770089, 21743762547, 15015326363, 67590889108, 26062154719, 36530438276, 25925929956
Offset: 1

Views

Author

Eric Angelini and Jean-Marc Falcoz, May 13 2020

Keywords

Comments

The rule used here is that the rightmost digit of a(n+1) is the first digit of the sum a(n) + a(n+1), the other digits of the said sum being put after the comma in order to start a(n+2).
As no digit 0 (zero) can start a term, one will have to backtrack sometimes in order to extend the sequence - and pick another term for a(n+1), compatible with the above rule. This is always possible.
Note that the sequence is not monotonically increasing as shown by a(10) and a(11) for instance; still, the 1000th term is 406-digit long.
The sequence is always extended with the smallest available integer not yet present that does not lead to a contradiction.

Examples

			a(1) + a(2) is 1 + 11 = 12 and 12 can be seen here: 1(1,2)3,
a(2) + a(3) is 11 + 23 = 34 and 34 can be seen here: 2(3,4)6,
a(3) + a(4) is 23 + 46 = 69 and 69 can be seen here: 4(6,9)1,
a(4) + a(5) is 46 + 91 = 137 and 137 can be seen here: 9(1,37)4,
a(5) + a(6) is 91 + 374 = 465 and 465 can be seen here: 37(4,65)06, etc.
		

Crossrefs

Showing 1-4 of 4 results.