A256104 Differential autobiographical numbers: number n = x0 x1 x2 ... x9 such that xi is the number of pairs (xj, xk), j different from k, where |xj - xk| = i.
20404, 31330
Offset: 1
Examples
31330 is in the sequence because: |x0 - x2| = 0, |x0 - x3| = 0 and |x2 - x3| = 0 => x0 = 3; |x1 - x3| = 1 => x1 = 1; |x0 - x1| = 2, |x1 - x2| = 2 and |x1 - x3| = 2 => x2 = 3; |x0 - x4| = 3, |x2 - x4| = 3 and |x3 - x4| = 3 => x2 = 3; |xj - xk| = 4 does not occur for all j and k => x4 = 0.
Programs
-
Maple
for n from 10 to 10^10 do: x:=convert(n,base,10):n0:=nops(x):T:=array(0..9): for a from 0 to 9 do: T[a]:=0: od: for i from 0 to 9 do: for j from 1 to n0-1 do: for k from j+1 to n0 do: if abs(x[j]-x[k])= i then T[i]:=T[i]+1: else fi: od: od: od: s:=sum('T[m]*10^(n0-m-1)', 'm'=0..9): if s=n then print(n) else fi:od:
Comments