OFFSET
1,3
COMMENTS
Any repdigit number (A010785) is in the sequence; 2-digit numbers 10a + b are in the sequence iff |a - b| = 2 or 0. See examples for more explanations.
The number 13 is the smallest prime for which the result of the "slide" operation yields a different prime, 31.
Theorem: If a number n with L digits is in the sequence because it can produce a number m ending p places to the right of the original number, then a digit p can be prefixed or appended, and one also gets a term of the sequence as concatenate(L+1+p, n) and concatenate(n, L+1-p), provided that L+1+p < 10, resp. L+1-p >= 0. Similarly, if m ends p places to the left of n, with concatenate(L+1-p, n) resp. concatenate(n, L+1+p). [The latter could be included in the former case by taking p negative, but using the absolute value when p is to be concatenated.]
Remark: Some repdigits d...d can "reproduce" less than d digits to the left or right: e.g., 2222 -> _2222 if all but the last 2's are moved two places to the right, but the last 2 is moved two places to the left.
Not all terms of this sequence can be obtained starting from { 0, ..., 9 } and the construction given in the above Theorem, possibly keeping intermediate terms with leading zeros. The term a(123) = 1043 is the first counterexample.
Distinguished subsets include that of numbers n that can be "slid" into m ending in p places later such that:
- m = n ("invariant" or "auto-slideable numbers", e.g., 12222), cf. A295010;
- p = 0 (position invariant, e.g., n = 112, m = 211);
- m = n and p = 0 (position invariant fixed points, e.g., 11, 110, 202);
- m is prime ("prime-slideable numbers", e.g., n = 35, m = 53), cf. A296236;
- n and m are prime (prime-slideable primes, e.g., n = 13, m = 31).
LINKS
M. F. Hasler, Table of n, a(n) for n = 1..1933
EXAMPLE
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).
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
PROG
(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))}
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Eric Angelini and M. F. Hasler, Dec 09 2017
STATUS
approved