OFFSET
1,1
COMMENTS
n is an anagram of n+k when k is a multiple of 9.
FORMULA
From Chai Wah Wu, Dec 23 2016: (Start)
a(n) = a(n-1) + a(n-8) - a(n-9) for n > 9.
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).
First difference is 8-periodic: 11,11,11,11,11,11,23,11,... (End)
EXAMPLE
24 is a term of the sequence because 24 and 24+18 = 42 are anagrams.
MATHEMATICA
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]]
PROG
(PARI) isok(n) = vecsort(digits(n)) == vecsort(digits(n+18)); \\ Michel Marcus, Jan 08 2016
(Magma) [n: n in [0..700] | Sort(Intseq(n)) eq Sort(Intseq(n+18))]; // Bruno Berselli, Jan 08 2016
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Vincenzo Librandi, Jan 06 2016
STATUS
approved