Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A097468
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A097468 Number of 1's in the decimal expansion of the lesser of twin primes. +0
1
0, 0, 2, 1, 0, 1, 0, 1, 2, 1, 1, 1, 1, 2, 1, 0, 0, 0, 1, 2, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 2, 2, 1, 2, 2, 3, 1, 1, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 0, 1, 0, 3, 1, 2, 0, 0, 0, 0, 1, 0, 1, 0, 0, 2, 0, 0, 1, 0, 0, 2, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1 (list; graph; listen)
OFFSET

2,3

COMMENT

n=5000,d=1 in Pari code below.

EXAMPLE

11 is the third lesser twin prime so 2 is the third entry

PROGRAM

(PARI) g(n, d) = forprime(x=1, n, if(isprime(x+2), print1(countchr(x, d)", "))) \Count the occurrences of char in string str countchr(str, char) = { local(ln, x, c); str=Str(str); \This allows leaving quotes off input char=Str(char); c=0; ln=length(str); for(x=1, ln, if(mid(str, x, 1)==char, c++); ); return(c) } \ Get a substring of length n from string str starting at position s in str. mid(str, s, n) = { local(v, ln, x, tmp); v =""; tmp = Vec(str); ln=length(tmp); for(x=s, s+n-1, v=concat(v, tmp[x]); ); return(v) }

CROSSREFS

Adjacent sequences: A097465 A097466 A097467 this_sequence A097469 A097470 A097471

Sequence in context: A050317 A141095 A099313 this_sequence A098381 A030372 A065363

KEYWORD

base,nonn

AUTHOR

Cino Hilliard (hillcino368(AT)gmail.com), Aug 23 2004

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified October 13 09:05 EDT 2008. Contains 145008 sequences.


AT&T Labs Research