Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A156053
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A156053 Let m = A002445(n); then a(n) = largest member of A001359 (the lesser twin primes sequence) <= m. +0
1
5, 29, 41, 2729, 137, 14321, 281, 3404309, 33329, 641, 4206929, 1366529, 281189, 7589, 625169, 5009, 2081, 63029, 5477, 2657, 2801, 15269, 19469, 25997, 49169, 11489, 23909, 289109, 14009, 129629, 32909, 3254729, 88577309, 93809, 412589 (list; graph; listen)
OFFSET

1,1

LINKS

Wikimedia Commons, Alternate plot

PROGRAM

(PARI) \\ uses Pari functions ispseudoprime, denominator, and list \\ tp2cnt =count of adjacent, unique twin primes (lower) \\ p2cnt = count of unique adjacent primes \\ N = Bernoulli # maxx= max N idx*=list pointers \\ u=array of adj. unique TP u2=array of adj. unique primes cnt=0; pcnt=0; n=1; opcnt=0; plcnt=0; phcnt=0; tpcnt=0; otpcnt=0; tp2cnt=0; p2cnt=0; limmit=429000001; \\4E8 idx=1; \\init idx2=1;

\\init if(maxx<2, maxx=2); if(maxx>200000, maxx=200000); print ("enforced n max = ", maxx); u=listcreate(500); \\unique entries < 10% TP u2=listcreate(5000); \\unique entries < 50% while(n<maxx+1, if(bernfrac(n)==0, n++) ; \\guard against 0 division m=abs(denominator(bernfrac(n)) ); p=m-1; q=m+1;

\\ we check to either side cnt++; if( ispseudoprime(p)==1, plcnt++ ); if( ispseudoprime(q)==1, phcnt++ ); if( ispseudoprime(q)==1 || ispseudoprime(p)==1, pcnt++ ); if( ispseudoprime(q)==1 && ispseudoprime(p)==1, tpcnt++ ); if( tpcnt>otpcnt, print("TP! @ ", n, " ", q, " "

\\IF.FOR, IF if(p>0, listput(u, p, idx); tp2cnt++ ); if(p>0, idx++) ); \\ end IF if( pcnt>opcnt, if(p>limmit, p=0); \\lower if(ispseudoprime(p)==0, p=0); if(p>0, for(z=1, idx2-1, if(p==u2[z], p=0); ); ); if(p>0, listput(u2, p, idx2); p2cnt++); if(p>0, idx2++); if(q>limmit, q=0);

\\upper if(ispseudoprime(q)==0, q=0); if(q>0, for(z=1, idx2-1, if(q==u2[z], q=0); ); ); if(q>0, listput(u2, q, idx2); p2cnt++); if(q>0, idx2++) ); \\ end IF opcnt=pcnt; otpcnt=tpcnt; n++ ); \\end WHILE if(cnt>0, print(2.*p2cnt/cnt) ); \\reflect every other (n.z.) print ("TP count = ", tp2cnt ); print ("enforced n max = ", maxx);

CROSSREFS

Cf. A002445

Sequence in context: A167742 A107151 A117746 this_sequence A081116 A146829 A141374

Adjacent sequences: A156050 A156051 A156052 this_sequence A156054 A156055 A156056

KEYWORD

easy,nonn

AUTHOR

Bill R. McEachen (bmceache(AT)centralsan.org), Feb 02 2009

EXTENSIONS

Edited by N. J. A. Sloane, Oct 21 2009

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 November 30 13:13 EST 2009. Contains 167758 sequences.


AT&T Labs Research