A296242 Slideable numbers: each digit d can be displaced by d positions either to the left or to the right, without creating a hole or an "overlap".
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 20, 22, 24, 31, 33, 35, 42, 44, 46, 53, 55, 57, 64, 66, 68, 75, 77, 79, 86, 88, 97, 99, 102, 110, 111, 112, 113, 114, 120, 122, 132, 135, 144, 201, 202, 211, 213, 221, 222, 225, 231, 243, 246, 255, 300, 311, 312, 324, 330, 333, 336, 342, 354
Offset: 1
Examples
Repdigit numbers (0, ..., 9, 11, 22, 33, ...) are in the sequence because each digit d can be shifted, e.g., by d places to the left, and the same number will result. The number 10 is not in the sequence, because the digit 0 must remain at the same place, and the digit 1 cannot be moved neither to the left (which would create a "hole"), nor to the right (place already occupied by the digit 0). Similarly, the number 12 is not in the sequence because shifting the digit 2 two places to the left is not possible if the 1 is also shifted 1 place to the left (which would be the same position), nor when the 1 is shifted to the right (which would create a hole), and shifting the 2 to the right would always create a hole. The number 13 is in the sequence because one can shift the digit 1 one place to the left, and the digit 3 two places to the left, resulting in the number 31__ (where the _ stands for empty places previously occupied by some digit). The number 102 is in the sequence, it results in the number 120_ if the 1 and the 2 are both shifted to the left. Similarly, 201 would result in _021 = 21. The number 113 results in 311_ if the 1's switch places and the 3 moves to the left. The number 114 results in 411__ if the two 1's and the 4 all move to the left (by the respective distances). The number 202 is in the sequence because the two 2's can switch places. As the repdigit numbers, it can be considered as a fixed point or invariant of the operation, since it can reproduce itself. Similarly, 3003, 40004, 42024, ... are fixed points of this operation, and in the sequence. The number 2023 is also in the sequence, resulting in 3202_. The number 12222 is also an invariant, reproducing itself shifted one place to the right, if the 1 is shifted 1 place to the right and the 2's accordingly (i.e., to the left for the last one, and to the right for all others but the last one).
Links
- M. F. Hasler, Table of n, a(n) for n = 1..1933
Crossrefs
Programs
-
Maple
f:= proc(n) local L,d,x,Lx,M; L:= convert(n,base,10); d:= nops(L); for x from 0 to 2^d-1 do Lx:= convert(x+2^d,base,2)[1..d]; M:= {seq(i+(2*Lx[i]-1)*L[i],i=1..d)}; if nops(M)=d and max(M)-min(M)=d-1 then return true fi od; false end proc: select(f, [$0..1000]); # Robert Israel, Dec 14 2017
-
PARI
is(n,d=matdiagonal(n=digits(n)),v=n+[1..#n])={!n||forvec(s=vector(#d,i,[0,1]),vecmax(p=v-2*s*d)+1==vecmin(p)+#p&p==#Set(p)&&return(1))}
Comments