A180176 Lexicographically earliest permutation of the natural numbers such that a(n) != n and in decimal representation a(n) and n have at least one common digit.
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 21, 20, 23, 22, 25, 24, 27, 26, 29, 28, 31, 30, 33, 32, 35, 34, 37, 36, 39, 38, 41, 40, 43, 42, 45, 44, 47, 46, 49, 48, 51, 50, 53, 52, 55, 54, 57, 56, 59, 58, 61, 60, 63, 62, 65, 64, 67, 66, 69, 68, 71, 70, 73
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- Index entries for sequences that are permutations of the natural numbers
- Index entries for linear recurrences with constant coefficients, signature (1, 1, -1).
Programs
-
Mathematica
CoefficientList[Series[(-9 x^22 - 2 x^21 + 11 x^20 + 20 x^12 - 20 x^10 - 9 x^2 + x + 10) / ((x - 1)^2 (x + 1)), {x, 0, 100}], x] (* Vincenzo Librandi, Oct 23 2018 *)
Formula
From Chai Wah Wu, Oct 22 2018: (Start)
a(n) = a(n-1) + a(n-2) - a(n-3) for n > 22.
G.f.: (-9*x^22 - 2*x^21 + 11*x^20 + 20*x^12 - 20*x^10 - 9*x^2 + x + 10)/((x - 1)^2*(x + 1)). (End)
Comments