cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A160851 Numbers which are a difference of two of their own anagrams.

This page as a plain text file.
%I A160851 #24 Jun 08 2025 10:50:21
%S A160851 459,495,1089,1269,1467,1476,1503,1530,1692,1746,2385,2439,2493,2502,
%T A160851 2520,2538,2691,2853,3285,3501,3510,4095,4392,4590,4599,4671,4698,
%U A160851 4797,4896,4932,4950,4959,4968,4977,4986,4995,5238,5382,5409,6147,6174,6921,8019,8091
%N A160851 Numbers which are a difference of two of their own anagrams.
%C A160851 An anagram of a number k is a number formed by one of the k! permutations of its digits.
%C A160851 All terms are divisible by 9. - _David A. Corneth_, Jun 06 2025
%H A160851 David A. Corneth, <a href="/A160851/b160851.txt">Table of n, a(n) for n = 1..10000</a> (first 1000 terms from Gonzalo Martínez)
%H A160851 David A. Corneth, <a href="/A160851/a160851.gp.txt">PARI program</a>
%e A160851 459 = 954 - 495;
%e A160851 495 = 954 - 459;
%e A160851 1089 = 9108 - 8019;
%e A160851 1269 = 2961 - 1692;
%e A160851 1467 = 7641 - 6174;
%e A160851 1476 = 6147 - 4671;
%e A160851 2538 = 5823 - 3285;
%e A160851 6174 = 7641 - 1467;
%e A160851 10989 = 91908 - 80919;
%e A160851 12969 = 29961 - 16992.
%o A160851 (Python)
%o A160851 from itertools import permutations
%o A160851 def ok(k):
%o A160851     anagram = {int(''.join(p)) for p in permutations(str(k)) if p[0] != '0'}
%o A160851     anagram.discard(k)
%o A160851     return any(a != b and a - b == k for a in anagram for b in anagram)
%o A160851 print([k for k in range(10, 10000) if ok(k)]), #_Gonzalo Martínez_, May 28 2025
%o A160851 (PARI) \\ See Corneth link
%Y A160851 Cf. A055098, A384433.
%K A160851 nonn,base
%O A160851 1,1
%A A160851 _Claudio Meller_, May 28 2009
%E A160851 Definition edited by _R. J. Mathar_, May 30 2009
%E A160851 a(1), a(5)-a(15) inserted by _Gonzalo Martínez_ May 28 2025