Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A158790
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A158790 Numbers n such that (x^n+1/x^n)/sqrt(8)+1 is prime for x = sqrt(8)+sqrt(7). +0
1
1, 3, 11, 13, 77, 83, 181, 381, 525, 3829 (list; graph; listen)
OFFSET

1,2

COMMENT

This sequence is the result of the algorithm in the link.

LINKS

D.Broadhurst, The House That Jack Built

PROGRAM

(PARI) jackbuilt(n, a, b, c) =

{

local(x, y, y1);

x=sqrt(a)+sqrt(b);

y=(x^n+1/x^n)/sqrt(a)+ c;

y1=eval(mid(Str(y), 1, instr(Str(y), ".")-1));

}

jackbuilt2(m, n, a, b, c) =

{ local(j, y);

forstep(j=m, n, 2,

y=jackbuilt(j, a, b, c);

if(ispseudoprime(y), print(j", "y))

)

}

mid(str, s, n) = /* Get a substring of length n from string str starting at

position s in str. */

{

local(v, x, tmp);

v ="";

tmp = Vec(str);

for(x=s, s+n-1,

v=concat(v, tmp[x]);

);

return(v)

}

instr(str, match) = /*Get the position of occurrence of match in string str.*/

{

local(lns, lnm, x);

str=Str(str); /* This allows leaving quotes off input*/

match=Str(match);

lnm=length(match);

lns=length(str);

for(x=1, lns-lnm+1,

if(mid(str, x, lnm)==match, return(x))

)

}

CROSSREFS

Sequence in context: A079665 A083992 A105290 this_sequence A063963 A101585 A115214

Adjacent sequences: A158787 A158788 A158789 this_sequence A158791 A158792 A158793

KEYWORD

more,nonn

AUTHOR

Cino Hilliard (hillcino368(AT)hotmail.com), Mar 26 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 25 20:09 EST 2009. Contains 167514 sequences.


AT&T Labs Research