A363820 Moving the rightmost digit of a number to place it furthest to the left adds 9 to the number.
12, 23, 34, 45, 56, 67, 78, 89, 101, 212, 323, 434, 545, 656, 767, 878, 989, 1101, 2212, 3323, 4434, 5545, 6656, 7767, 8878, 9989, 11101, 22212, 33323, 44434, 55545, 66656, 77767, 88878, 99989, 111101, 222212, 333323, 444434, 555545, 666656, 777767, 888878, 999989
Offset: 1
Examples
a(1) = 12 plus 9 = 21; the rightmost 2 is now in front and 1 at the end; a(2) = 23 plus 9 = 32; the rightmost 3 is now in front and 2 at the end; a(3) = 34 plus 9 = 43; the rightmost 4 is now in front and 3 at the end; a(4) = 45 plus 9 = 54; the rightmost 5 is now in front and 4 at the end; ... a(9) = 101 plus 9 = 110; the rightmost 1 is now in front and 0 at the end; etc.
Links
- Andrew Howroyd, Table of n, a(n) for n = 1..1000
Programs
-
Mathematica
Select[Range[10^6],FromDigits[RotateRight[IntegerDigits[#]]]-#==9 &] (* Stefano Spezia, Oct 18 2023 *)
-
PARI
a(n) = if(n > 0, (n%9 + 1)*(10^(n\9 + 2)-1)/9 - 10) \\ Andrew Howroyd, Oct 22 2023
-
Python
def ok(n): s = str(n); return int(s[-1]+s[:-1]) - n == 9 print([k for k in range(10**6) if ok(k)]) # Michael S. Branicky, Oct 18 2023
Comments