cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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".

This page as a plain text file.
%I A296242 #39 Feb 27 2020 16:26:41
%S A296242 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,
%T A296242 68,75,77,79,86,88,97,99,102,110,111,112,113,114,120,122,132,135,144,
%U A296242 201,202,211,213,221,222,225,231,243,246,255,300,311,312,324,330,333,336,342,354
%N 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".
%C A296242 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.
%C A296242 The number 13 is the smallest prime for which the result of the "slide" operation yields a different prime, 31.
%C A296242 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.]
%C A296242 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.
%C A296242 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.
%C A296242 Distinguished subsets include that of numbers n that can be "slid" into m ending in p places later such that:
%C A296242 - m = n ("invariant" or "auto-slideable numbers", e.g., 12222), cf. A295010;
%C A296242 - p = 0 (position invariant, e.g., n = 112, m = 211);
%C A296242 - m = n and p = 0 (position invariant fixed points, e.g., 11, 110, 202);
%C A296242 - m is prime ("prime-slideable numbers", e.g., n = 35, m = 53), cf. A296236;
%C A296242 - n and m are prime (prime-slideable primes, e.g., n = 13, m = 31).
%H A296242 M. F. Hasler, <a href="/A296242/b296242.txt">Table of n, a(n) for n = 1..1933</a>
%e A296242 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.
%e A296242 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).
%e A296242 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.
%e A296242 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).
%e A296242 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.
%e A296242 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).
%e A296242 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.
%e A296242 The number 2023 is also in the sequence, resulting in 3202_.
%e A296242 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).
%p A296242 f:= proc(n) local L,d,x,Lx,M;
%p A296242   L:= convert(n,base,10);
%p A296242   d:= nops(L);
%p A296242   for x from 0 to 2^d-1 do
%p A296242     Lx:= convert(x+2^d,base,2)[1..d];
%p A296242     M:= {seq(i+(2*Lx[i]-1)*L[i],i=1..d)};
%p A296242     if nops(M)=d and max(M)-min(M)=d-1 then return true fi
%p A296242   od;
%p A296242   false
%p A296242 end proc:
%p A296242 select(f, [$0..1000]); # _Robert Israel_, Dec 14 2017
%o A296242 (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))}
%Y A296242 Cf. A295010 (self-slideable numbers), A296236 (prime-slideable numbers) and A010785 (repdigits) all are subsequences.
%K A296242 nonn,base
%O A296242 1,3
%A A296242 _Eric Angelini_ and _M. F. Hasler_, Dec 09 2017