Original entry on oeis.org
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 22, 24, 25, 27, 28, 30, 33, 34, 40, 41, 42, 44, 45, 46, 47, 50, 51, 52, 53, 60, 61, 62, 63, 64, 66, 70, 71, 72, 73, 74, 80, 81, 82, 83, 84, 85, 90, 91, 92, 93, 94, 100, 101, 102, 103, 104, 105, 106, 222, 223, 224, 225, 226, 227, 228, 229, 240, 242, 244, 245
Offset: 1
-
Union@ FoldList[Max, 0, #] &@ Nest[Function[s, Block[{k = 1, id = IntegerDigits@ s[[-1]]}, While[MemberQ[s, k] || Intersection[id, IntegerDigits@ k] != {}, k++]; Append[s, k]]], {1}, 160] (* Michael De Vlieger, Feb 22 2017, after Robert G. Wilson v at A067581 *)
Original entry on oeis.org
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 16, 20, 22, 26, 28, 30, 32, 35, 37, 39, 41, 43, 45, 47, 48, 50, 52, 54, 55, 57, 59, 61, 63, 65, 66, 68, 70, 72, 74, 75, 77, 79, 81, 83, 85, 86, 88, 90, 92, 94, 95, 97, 99, 101, 103, 105, 107, 108, 110
Offset: 1
-
Function[t, 1 + Flatten[Map[Position[t, #] &, Union@ FoldList[Max, 0, t]] /. {} -> {{0}}]]@ Nest[Function[s, Block[{k = 1, id = IntegerDigits@ s[[-1]]}, While[MemberQ[s, k] || Intersection[id, IntegerDigits@ k] != {}, k++]; Append[s, k]]], {1}, 160] (* Michael De Vlieger, Feb 22 2017, after Robert G. Wilson v at A067581 *)
A136332
a(n) is the smallest term appearing after a(n-1) in A067581.
Original entry on oeis.org
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 21, 29, 31, 32, 35, 36, 37, 38, 39, 43, 48, 49, 53, 54, 55, 56, 65, 67, 75, 76, 77, 78, 86, 87, 88, 89, 95, 96, 97, 98, 99, 106, 107, 108, 109, 110, 111, 112, 120, 123, 132, 192, 210, 212, 213, 231, 251, 312, 318, 319, 321, 324
Offset: 1
a(13) = 21 because 21 is the lowest term appearing after 12 in A067581
Original entry on oeis.org
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 53, 106, 298, 5790, 7594, 14650, 15576, 41612, 66049, 150564, 154476, 154484
Offset: 1
A184992
a(n) is the least positive integer not occurring earlier that shares a digit with a(n-1); a(1)=1.
Original entry on oeis.org
1, 10, 11, 12, 2, 20, 21, 13, 3, 23, 22, 24, 4, 14, 15, 5, 25, 26, 6, 16, 17, 7, 27, 28, 8, 18, 19, 9, 29, 32, 30, 31, 33, 34, 35, 36, 37, 38, 39, 43, 40, 41, 42, 44, 45, 46, 47, 48, 49, 54, 50, 51, 52, 53, 55, 56, 57, 58, 59, 65, 60, 61, 62, 63, 64, 66, 67, 68, 69, 76, 70, 71, 72, 73
Offset: 1
-
import Data.List (delete, intersect); import Data.Function (on)
a184992 n = a184992_list !! (n-1)
a184992_list = 1 : f 1 [2..] where
f u vs = v : f v (delete v vs)
where v : _ = filter (not . null . (intersect `on` show) u) vs
-- Reinhard Zumkeller, Jul 01 2013
-
FromDigits /@ Nest[Function[a, Append[a, Block[{k = 2, d}, While[Nand[FreeQ[a, #], IntersectingQ[a[[-1]], #]] &@ Set[d, IntegerDigits@ k], k++]; d]]], {{1}}, 73] (* Michael De Vlieger, Mar 17 2018 *)
-
A184992(n,show=0)={my(a=1,u=2^1);for(k=2,n,show && print1(a",");a=Set(Vec(Str(a))); for(j=2,9e9,bittest(u,j) && next;setintersect(Set(Vec(Str(j))),a) || next; u+=2^a=j; break));a} \\ M. F. Hasler, Dec 22 2011
-
from itertools import count, islice
def agen(): # generator of terms
an, aset, mink = 1, {1}, 1
while True:
yield an
digset = set(str(an))
an = next(k for k in count(mink) if k not in aset and set(str(k))&digset)
aset.add(an)
while mink in aset: mink += 1
print(list(islice(agen(), 74))) # Michael S. Branicky, Oct 03 2024
A276633
a(n) = smallest integer not yet in the sequence with no digits in common with a(n-1) and a(n-2); a(0)=0, a(1)=1.
Original entry on oeis.org
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 22, 33, 11, 20, 34, 15, 26, 30, 14, 25, 36, 17, 24, 35, 16, 27, 38, 19, 40, 23, 18, 44, 29, 13, 45, 28, 31, 46, 50, 12, 37, 48, 21, 39, 47, 51, 32, 49, 55, 60, 41, 52, 63, 70, 42, 53, 61, 72, 43, 56, 71, 80, 54, 62, 73, 58, 64, 77, 59, 66, 74, 81, 65, 79
Offset: 0
From _David A. Corneth_, Sep 22 2016: (Start)
Each number can consist of 2^10-1 sets of distinct digits, i.e., classes. For example, 21132 is in the class {1, 2, 3}. We don't include a number without digits. For this sequence, we can also exclude numbers with only the digit 0. This leaves 1022 classes. We create a list with a place for each class containing the least number from that class not already in the sequence.
To illustrate the algorithm used to create the current b-file, we'll (for brevity) assume we've already calculated all terms for n = 1 to 100 and that we already know which classes will be used to compute the next 10 terms, for n = 101 to 110.
These classes are: {0, 1}, {2, 3}, {5, 9}, {7, 9}, {8, 9}, {0, 1, 6}, {0, 1, 7}, {2, 2, 2} and {2, 2, 4} having the values 110, 223, 95, 97, 89, 106, 107, 222 and 224. a(99) = 104 and a(100) = 88, so from those values we may only choose from {223, 95, 97 and 222}. The least value in the list is 95. Therefore, a(101) = 95. The number for the class is now replaced with the next larger number having digits {5, 9} (=A276769(95)), being 559.
(One may see that in the example I only listed 9 classes. Class {8, 9} occurs twice in the example; a(104) = 89 and a(107) = 98.)
From a list of computed values up to some n, the values for classes may be updated to compute further. E.g., to compute a(20000), one may use the b-file to find the least number not already in the sequence for each class and then proceed from a(19998) and a(19999), etc. (End)
-
N:= 10^3: # to get all terms before the first > N
for R in combinat:-powerset({$0..9}) minus {{},{$0..9}} do
Lastused[R]:= [];
MR[R]:= Array[0..9];
for i from 1 to nops(R) do MR[R][R[i]]:= i od:
od:
A[0]:= 0: A[1]:= 1:
S:= {0,1}:
for n from 2 to N do
R:= {$0..9} minus (convert(convert(A[n-1],base,10),set) union convert(convert(A[n-2],base,10),set));
L:= Lastused[R];
x:= 0;
while member(x,S) do
for d from 1 do
if d > nops(L) then
if R[1] = 0 then L:= [op(L),R[2]] else L:= [op(L),R[1]] fi;
break
elif L[d] < R[-1] then
L[d]:= R[MR[R][L[d]]+1]; break
else
L[d]:= R[1];
fi
od;
x:= add(L[j]*10^(j-1),j=1..nops(L));
od;
A[n]:= x;
S:= S union {x};
Lastused[R] := L;
od:
seq(A[i],i=0..N); # Robert Israel, Sep 20 2016
-
s={0,1};Do[a=s[[-2]];b=s[[-1]];n=2;idab=Union[IntegerDigits[a],IntegerDigits[b]]; While[MemberQ[s,n]|| Intersection[idab,IntegerDigits[n]]!={},n++];AppendTo[s, n],{100}];s
-
from itertools import count, islice, product as P
def only(s, D=1): # numbers with >= D digits only from s
yield from (int("".join(p)) for d in count(D) for p in P(s, repeat=d))
def agen(): # generator of terms
aset, an1, an, minan = {0, 1}, 0, 1, 2
yield from [0, 1]
while True:
an1, an, s = an, minan, set(str(an) + str(an1))
use = "".join(c for c in "0123456789" if c not in s)
for an in only(use, D=len(str(minan))):
if an not in aset: break
aset.add(an)
yield an
while minan in aset: minan += 1
print(list(islice(agen(), 75))) # Michael S. Branicky, Jun 30 2022
A068861
a(1) = 1; a(n+1) is the smallest number not already in the sequence which differs from a(n) at every digit.
Original entry on oeis.org
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 21, 12, 20, 11, 22, 13, 24, 15, 23, 14, 25, 16, 27, 18, 26, 17, 28, 19, 30, 29, 31, 40, 32, 41, 33, 42, 34, 43, 35, 44, 36, 45, 37, 46, 38, 47, 39, 48, 50, 49, 51, 60, 52, 61, 53, 62, 54, 63, 55, 64, 56, 65, 57, 66, 58, 67, 59, 68, 70, 69, 71, 80
Offset: 1
11 follows 20 as the smallest number not included earlier and differing at every digit position.
A344325
Squares visited on a spirally numbered board when stepping to the closest unvisited square which contains a number that shares no digit with the number of the current square. If two or more such squares are the same distance away the one with the smaller number is chosen.
Original entry on oeis.org
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 25, 48, 79, 80, 49, 26, 51, 84, 125, 83, 50, 81, 52, 86, 53, 28, 11, 27, 85, 126, 87, 54, 29, 30, 55, 88, 129, 56, 31, 58, 93, 57, 90, 131, 89, 130, 92, 135, 94, 137, 95, 60, 33, 14, 32, 59, 13, 62, 35, 16, 34, 15, 36, 17, 38, 67, 104, 66, 37, 64, 99, 100, 65, 102
Offset: 1
The board is numbered with the square spiral:
.
17--16--15--14--13 .
| | .
18 5---4---3 12 29
| | | | |
19 6 1---2 11 28
| | | |
20 7---8---9--10 27
| |
21--22--23--24--25--26
.
a(2) = 2 as from 1 there are four numbers one unit away, 2,4,6,8, none of which contain the digit 1, so of these the smallest is chosen, which is 2.
a(11) = 25 as from the square 10 the square with 25 is only one unit away and shares no digit with 10.
a(20) = 83 as the four squares one unit away from 125 have been visited or contain digits 1,2 or 5. The square with 83 is diagonally adjacent to 125 and is the first time a square more than one unit away is stepped to.
a(23) = 52, and is the first square stepped to that is not adjacent to the previous square, being three units away from 81. All closer squares have been either visited or contain a 1 or 8 in their number.
A344367
Squares visited on a spirally numbered board when stepping to the closest unvisited square that contains a number that shares one or more digits with the number of the current square. If two or more such squares are the same distance away the one with the smaller number is chosen.
Original entry on oeis.org
1, 11, 10, 12, 13, 14, 15, 16, 17, 18, 19, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 3, 23, 22, 21, 20, 40, 41, 42, 43, 44, 45, 46, 47, 24, 25, 26, 27, 28, 29, 2, 52, 51, 50, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 59, 58, 57, 56, 55, 54, 53, 125, 124, 123, 122, 121, 120
Offset: 1
The board is numbered with the square spiral:
.
17--16--15--14--13 .
| | .
18 5---4---3 12 29
| | | | |
19 6 1---2 11 28
| | | |
20 7---8---9--10 27
| |
21--22--23--24--25--26
.
a(2) = 11. There are three squares 2 units away from the starting square 1 that also contain the digit 1 - 11, 15, and 19. Of these 11 is the smallest so is the square stepped to.
a(3) = 10. Of the two adjacent squares to 11 that also contain the digit 1 the square 10 is the smallest.
a(4) = 12. This is the only unvisited square within 2 units of a(3) = 10 that also contains the digit 1.
a(12) = 39. This is the only unvisited square within sqrt(2) units of a(11) = 19 that contains either the digit 3 or 9. It is also the first square stepped to that does not share the digit 1 with the previous square.
A362075
a(1) = 1, a(2) = 2; for n > 2, a(n) is the least positive integer not occurring earlier such that a(n) shares no digit with a(n-2) + a(n-1).
Original entry on oeis.org
1, 2, 4, 3, 5, 6, 7, 8, 9, 20, 10, 11, 30, 22, 13, 12, 14, 15, 16, 24, 17, 23, 18, 25, 19, 21, 26, 28, 27, 29, 31, 32, 40, 33, 41, 35, 34, 37, 36, 42, 39, 43, 44, 45, 46, 38, 50, 47, 48, 60, 49, 52, 53, 62, 63, 64, 54, 55, 56, 57, 58, 66, 59, 67, 70, 65, 68, 69, 80, 72, 73, 76, 75, 74, 77, 78
Offset: 1
a(10) = 20 as a(8) + a(9) = 8 + 9 = 17, and 20 is the smallest unused number that does not contain the digits 1 or 7.
Showing 1-10 of 25 results.
Comments