OFFSET
1,11
EXAMPLE
a(25)=6 since A081227[1..25] has 6 ones and 19 zeros.
MAPLE
digcomp := proc(A, B) local a, b, crit, f; description "returns the digits that 'A' and 'B' have in common; if a third argument is given and it is 'sum' then the sum of the common digits is returned, else if it is 'num' then the number of common digits is returned."; if nargs>2 then crit := args[3] else crit := NULL fi; a := convert(`if`(A=0, [0], (convert(A, base, 10))), set); b := convert(`if`(B=0, [0], (convert(B, base, 10))), set); f := a intersect b; if crit=sum then return `if`(nops(f)>0, `+`(op(f)), -1) elif crit=num then return nops(f) else return f; fi; end proc; ListTools[PartialSums]([seq(digcomp(i, ithprime(i), num), i=1..200)]);
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Francois Jooste (pin(AT)myway.com), Mar 11 2003
STATUS
approved