A242437 Numbers not appearing in the sequence of integers, beginning with 1, that can be formed by adding any digit of any previous term to that previous term.
3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 21, 23, 25, 27, 29, 31, 43, 47, 51, 65, 71, 87, 95
Offset: 1
Examples
17 is not in this sequence because 1+1=2, 2+2=4, 4+4=8, 8+8=16, 16+1=17. 39 is not in this sequence because 1+1=2, 2+2=4, 4+4=8, 8+8=16, 16+6=22, 22+2=24, 24+4=28, 28+8=36, 36+3=39. 23 is in this sequence because there is no way to start at 1 and arrive at 23. (See A241175 for definition difference.)
Crossrefs
Cf. A241175.
Programs
-
Python
complete = [] complete.append(1) complete.append(2) complete.append(4) complete.append(8) final = [] for a in range(2,10000000):#search through 10^8 b = str(a) for c in reversed(range(1,10)):#search the previous 9 integers d = str(a-c) if a - c in complete[-9:] and str(c) in d: complete.append(a)#this number can be made by digit addition break if c == 1:#If all 9 attempts fail final.append(a)#This is a member of the new sequence print(final)
Comments