Search: id:A081229 Results 1-1 of 1 results found. %I A081229 %S A081229 1,1,1,1,1,1,7,1,1,1,1,1,1,4,1,1,1,1,1,1,1,1,3,1,1,1,1,1,9,3,1,3,3,3,1, %T A081229 1,7,3,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,5,5,6,1,1,1,1,1,2,3,1,1,1,1,1,1,1, %U A081229 1,1,10,7,7,1,1,7,1,0,1,2,3,4,1,1,1,1,1,1,1,9,1,13,9,1,9,1,1,1,1,1,3,1 %V A081229 -1,-1,-1,-1,-1,-1,7,-1,-1,-1,1,-1,1,4,-1,-1,-1,1,-1,-1,-1,-1,3,-1,-1, -1,-1,-1,9,3,1,3, %W A081229 3,3,-1,-1,7,3,-1,-1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,-1,5,5,6,-1,-1, -1,-1,-1,2,3,-1, %X A081229 -1,-1,-1,-1,-1,-1,-1,-1,10,7,7,-1,-1,7,-1,0,1,2,3,4,-1,-1,-1,-1,-1,-1, -1,9,-1,13,9,-1 %N A081229 a(n) is the sum of the common digits of n and the n-th prime in base 10, or -1 if there are no common digits. %C A081229 Repeated digits are to be ignored; e.g. 2001 and 4050 have only one digit in common, 0. %e A081229 a(73)=10 since the 73rd prime is 367 (3+7=10). %p A081229 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; F := ([seq(digcomp(i,ithprime(i),sum),i=1..75)]); %o A081229 (PARI) digitset(n) = local(v,d);v=[];while(n>0,d=divrem(n,10);n=d[1]; v=concat(d[2],v));Set(v) %o A081229 {for(n=1,94,s=setintersect(digitset(n),digitset(prime(n)));v=eval(s); print1(if(v==[],-1,sum(j=1,#v,v[j])),","))} [Klaus Brockhaus, Dec 19 2006] %Y A081229 Cf. A081227, A081228. %Y A081229 Sequence in context: A070672 A055061 A074465 this_sequence A109010 A117825 A010143 %Y A081229 Adjacent sequences: A081226 A081227 A081228 this_sequence A081230 A081231 A081232 %K A081229 base,sign %O A081229 1,7 %A A081229 Francois Jooste (pin(AT)myway.com), Mar 11 2003 %E A081229 Entries checked by Klaus Brockhaus, Dec 19 2006 Search completed in 0.001 seconds