A081229: something's wrong...

Klaus Brockhaus klaus-brockhaus at t-online.de
Tue Dec 19 23:38:59 CET 2006


There is only a tiny error (typo?) in the definition: 
	..... or -1 if there are no common digits.

The following PARI code is perhaps easier to read than the MAPLE code given in the entry; it confirms all terms.

digitset(n) = local(v,d);v=[];while(n>0,d=divrem(n,10);n=d[1];v=concat(d[2],v));Set(v)

{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

---------------------

zak seidov wrote:
> 
> Something's totally wrong with entries...
> 
> Thanks, Zak
> 
> %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 0 if
>                there are no common digits.
> %C A081229 Repeated digits 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).
>






More information about the SeqFan mailing list