|
Search: id:A104215
|
|
|
| A104215 |
|
Numbers n such that the sum of the digits of the n-th lower twin prime is a lower twin prime. |
|
+0 1
|
|
| 1, 5, 11, 13, 14, 15, 16, 18, 19, 24, 29, 31, 32, 33, 35, 36, 40, 43, 48, 52, 55, 57, 62, 63, 64, 69, 71, 74, 77, 80, 82, 84, 85, 86, 88, 94, 97, 98, 101, 106, 109, 111, 112, 115, 116, 117, 118, 124, 125, 130, 132, 135, 138, 140, 143, 145, 151, 154, 157, 160, 162, 163
(list; graph; listen)
|
|
|
OFFSET
|
1,2
|
|
|
EXAMPLE
|
The 13-th lower twin prime is 179. 1+7+9=17 the lower twin prime of the twin
pair (17,19).
|
|
PROGRAM
|
(PARI) sdtwtw(n) = { local(x, y); for(x=1, n, y=sumdigits(twinl(x)); if(istwin(y)<0, print1(x", ") ) ) } sumdigits(n) = \ The sum of the digits of n { local(x, j, s=0); x=digits(n); for(j=1, length(x), s+=x[j]; ); return(s) } digits(n) = \ The vector of the digits of n { return(eval(Vec(Str(n)))) } twinl(n) = \The n-th lower twin prime { local(c, x); c=0; x=1; while(c<n, if(isprime(prime(x)+2), c++); x++; ); return(prime(x-1)) } istwin(n) = \Return -1 if n is a lower twin, 1 if upper, otherwise return 0 { local(p1, p2); if(isprime(n), p1=n-2; p2=n+2; if(isprime(p1), return(1)); if(isprime(p2), return(-1)); return(0) ) }
|
|
CROSSREFS
|
Adjacent sequences: A104212 A104213 A104214 this_sequence A104216 A104217 A104218
Sequence in context: A102181 A103068 A070369 this_sequence A093685 A140475 A020611
|
|
KEYWORD
|
easy,nonn,base
|
|
AUTHOR
|
Cino Hilliard (hillcino368(AT)gmail.com), Mar 13 2005
|
|
|
Search completed in 0.002 seconds
|