login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Numbers n which are anagrams of n+18.
0

%I #19 Sep 08 2022 08:46:15

%S 13,24,35,46,57,68,79,102,113,124,135,146,157,168,179,202,213,224,235,

%T 246,257,268,279,302,313,324,335,346,357,368,379,402,413,424,435,446,

%U 457,468,479,502,513,524,535,546,557,568,579,602,613,624,635,646,657

%N Numbers n which are anagrams of n+18.

%C n is an anagram of n+k when k is a multiple of 9.

%F From _Chai Wah Wu_, Dec 23 2016: (Start)

%F a(n) = a(n-1) + a(n-8) - a(n-9) for n > 9.

%F G.f.: x*(-2*x^8 + 23*x^7 + 11*x^6 + 11*x^5 + 11*x^4 + 11*x^3 + 11*x^2 + 11*x + 13)/(x^9 - x^8 - x + 1).

%F First difference is 8-periodic: 11,11,11,11,11,11,23,11,... (End)

%e 24 is a term of the sequence because 24 and 24+18 = 42 are anagrams.

%t Select[Range[0, 600], Sort[IntegerDigits[#]] == Sort[IntegerDigits[# + 18]] &] (* or *) Reap[Do[If[Sort@IntegerDigits[n] == Sort@IntegerDigits[n + 18], Sow[n]], {n, 600}]][[-1, 1]]

%o (PARI) isok(n) = vecsort(digits(n)) == vecsort(digits(n+18)); \\ _Michel Marcus_, Jan 08 2016

%o (Magma) [n: n in [0..700] | Sort(Intseq(n)) eq Sort(Intseq(n+18))]; // _Bruno Berselli_, Jan 08 2016

%Y Cf. A228157.

%K nonn,base,easy

%O 1,1

%A _Vincenzo Librandi_, Jan 06 2016