login

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

Fixed points of permutations A252022 and A252023.
4

%I #11 Nov 16 2024 16:58:17

%S 1,2,3,4,5,36,72,125,136,900,4454,8021,27223,33905,73222,127536,

%T 146353,180177,234668,273241

%N Fixed points of permutations A252022 and A252023.

%o (Haskell)

%o a252079 n = a252079_list !! (n-1)

%o a252079_list = [x | x <- [1..], a252022 x == x]

%o (Python)

%o A252079_list, l, s, b = [1], [1], 2, set()

%o for n in range(2, 10**5):

%o i = s

%o while True:

%o if i not in b:

%o li = [int(d) for d in str(i)[::-1]]

%o for x, y in zip(li, l):

%o if x+y > 9:

%o break

%o else:

%o l = li

%o b.add(i)

%o if i == n:

%o A252079_list.append(i)

%o while s in b:

%o b.remove(s)

%o s += 1

%o break

%o i += 1 # _Chai Wah Wu_, Dec 14 2014

%Y Cf. A252022, A252023, A252078.

%K nonn,more

%O 1,2

%A _Reinhard Zumkeller_, Dec 13 2014

%E a(16)-a(20) from _Chai Wah Wu_, Dec 14 2014