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.

A260096 Numbers whose decimal and hexadecimal representations both have strictly decreasing digits.

This page as a plain text file.
%I A260096 #18 May 23 2020 13:14:03
%S A260096 0,1,2,3,4,5,6,7,8,9,10,32,50,64,65,80,81,82,83,84,96,97,98,210,54320,
%T A260096 54321,64320,64321,65210,764210
%N A260096 Numbers whose decimal and hexadecimal representations both have strictly decreasing digits.
%C A260096 Intersection of A009995 and A023797. - _Michel Marcus_, Jul 16 2015
%H A260096 <a href="https://twitter.com/wacnt/status/621469453138538496">Tweet by Wolfram|Alpha Can't</a>
%e A260096 54321 belongs to the sequence because its digits are strictly decreasing and its hexadecimal representation, D431, also has strictly decreasing digits.
%e A260096 976210 doesn't belong to the sequence because, while its decimal digits are strictly decreasing, its hexadecimal representation EE552 is not strictly decreasing.
%t A260096 dec[v_] := 0 > Max@ Differences@ v; Select[ Union[ FromDigits/@ Select[ Flatten[ Permutations/@ Subsets[ Range[0, 9]], 1], dec]], dec@ IntegerDigits[#, 16] &] (* _Giovanni Resta_, Jul 16 2015 *)
%o A260096 (Python)
%o A260096 def decreasing(top):
%o A260096     if top==0:
%o A260096         yield []
%o A260096         return
%o A260096     for d in range(top):
%o A260096         if d>0:
%o A260096             yield [d]
%o A260096         for s in decreasing(d):
%o A260096             yield [d]+s
%o A260096 def to_int(s):
%o A260096     t = 0
%o A260096     for d in s:
%o A260096         t = t*10+d
%o A260096     return t
%o A260096 def to_hex(n):
%o A260096     out = []
%o A260096     if n==0:
%o A260096         return [0]
%o A260096     while n:
%o A260096         m = n%16
%o A260096         n = (n-m)//16
%o A260096         out.insert(0,m)
%o A260096     return out
%o A260096 def is_decreasing(h):
%o A260096     m = h[0]
%o A260096     for d in h[1:]:
%o A260096         if d>=m:
%o A260096             return False
%o A260096         m = d
%o A260096     return True
%o A260096 ns = sorted(to_int(s) for s in list(decreasing(10)))
%o A260096 a = [n for n in ns if is_decreasing(to_hex(n))]
%Y A260096 Cf. A009995 (in base 10 only), A023797 (in base 16 only).
%K A260096 nonn,base,fini,full
%O A260096 1,3
%A A260096 _Christian Perfect_, Jul 16 2015