A119260 Numbers with even decimal digits in increasing order.
0, 2, 4, 6, 8, 24, 26, 28, 46, 48, 68, 246, 248, 268, 468, 2468
Offset: 1
Programs
-
Mathematica
Flatten@Table[FromDigits/@Subsets[Range[2,8,2],{n}],{n,0,5}]
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.
Flatten@Table[FromDigits/@Subsets[Range[2,8,2],{n}],{n,0,5}]
Sort@Flatten@Table[FromDigits/@Subsets[Range[8,0,-2],{n}],{n,5}]
The first rows start n | row n 1 | 0, 2 | 1, ... 10 | 9, 11 | 1, 0, 12 | 2, 0, 13 | 2, 1, 14 | 3, 0, 15 | 3, 1, 16 | 3, 2, 17 | 4, 0, ... The Sury paper lists the first rows of length 3, row 56 = (2, 1, 0), row 57 = (3, 1, 0), row 58 = (3, 2, 0), row 59 = (3, 2, 1), row 60 = (4, 1, 0), ...
concat(0,[digits(n)|n<-[1..99],is_A009995(n)])
perfectPowerQ[n_] := n==1 || GCD @@ FactorInteger[n][[All, 2]] > 1; (* A001597 *) Select[Range[1000], perfectPowerQ[#] && Max[Differences[IntegerDigits[#]]]<0 &]
perfectPowerQ[n_] :=n==1 || GCD @@ FactorInteger[n][[All, 2]] > 1; (* A001597 *) Select[Range[10^6], perfectPowerQ[#] && Max[Differences[IntegerDigits[#]]]<1 &]
54321 belongs to the sequence because its digits are strictly decreasing and its hexadecimal representation, D431, also has strictly decreasing digits. 976210 doesn't belong to the sequence because, while its decimal digits are strictly decreasing, its hexadecimal representation EE552 is not strictly decreasing.
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 *)
def decreasing(top): if top==0: yield [] return for d in range(top): if d>0: yield [d] for s in decreasing(d): yield [d]+s def to_int(s): t = 0 for d in s: t = t*10+d return t def to_hex(n): out = [] if n==0: return [0] while n: m = n%16 n = (n-m)//16 out.insert(0,m) return out def is_decreasing(h): m = h[0] for d in h[1:]: if d>=m: return False m = d return True ns = sorted(to_int(s) for s in list(decreasing(10))) a = [n for n in ns if is_decreasing(to_hex(n))]
For n = 5, the integers with distinct digits whose digital sum is 5 are: 5, 14, 23, 32, 41, 50, 104, 140, 203, 230, 302, 320, 401 and 410, where the largest of them is 410. So, a(5) = 410.
Comments