login
Append three digits, each increasing by one modulo 10 from the last digit of the nonnegative integers. 0 -> 123, 1 -> 1234 2 -> 2345, ... , 9 -> 9012, 10 -> 10123, etc.
0

%I #22 Apr 12 2023 10:52:08

%S 123,1234,2345,3456,4567,5678,6789,7890,8901,9012,10123,11234,12345,

%T 13456,14567,15678,16789,17890,18901,19012,20123,21234,22345,23456,

%U 24567,25678,26789,27890,28901,29012,30123,31234,32345,33456,34567,35678,36789,37890,38901

%N Append three digits, each increasing by one modulo 10 from the last digit of the nonnegative integers. 0 -> 123, 1 -> 1234 2 -> 2345, ... , 9 -> 9012, 10 -> 10123, etc.

%H <a href="/index/Rec#order_11">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,0,0,0,0,0,0,1,-1).

%F a(n) = 1000n + O(1).

%F G.f.: (988*x^10 +111*x^9 +1011*x^8 +1101*x^7 +1111*x^6 +1111*x^5 +1111*x^4 +1111*x^3 +1111*x^2 +1111*x +123) / (x^11 -x^10 -x +1). - _Alois P. Heinz_, Jul 05 2022

%p a:= n-> (d-> parse(cat(n, irem(d+i, 10)$i=1..3)))(irem(n, 10)):

%p seq(a(n), n=0..40); # _Alois P. Heinz_, Jul 05 2022

%o (Python)

%o def a(n): return int(str(n) + "".join(str((n%10+1+i)%10) for i in range(3)))

%o print([a(n) for n in range(39)]) # _Michael S. Branicky_, Jul 05 2022

%K nonn,base,easy

%O 0,1

%A _Felix Tubiana_, Oct 30 2009

%E More terms from _Alois P. Heinz_, Jul 05 2022