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).
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
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.
Links
- M. F. Hasler, Table of n, a(n) for n = 0..122
- Eric Angelini, Comma Sums
- Eric Angelini, Comma Sums [Cached copy, with permission]
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
Comments