tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
|
|
@ -0,0 +1,5 @@
|
|||
function z = isSelfDescribing(n)
|
||||
s = int2str(n)-'0'; % convert to vector of digits
|
||||
y = hist(s,0:9);
|
||||
z = all(y(1:length(s))==s);
|
||||
end;
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
for k = 1:1e10,
|
||||
if isSelfDescribing(k),
|
||||
printf('%i\n',k);
|
||||
end
|
||||
end;
|
||||
Loading…
Add table
Add a link
Reference in a new issue