login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A210650 Least number k>0 such that at least one of (2^k-1)*2^n-1, (2^k-1)*2^n+1, (2^k+1)*2^n-1, or (2^k+1)*2^n+1 is a prime number. 1
1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 1, 1, 1, 2, 2, 1, 1, 1, 1, 3, 3, 5, 5, 7, 2, 3, 4, 5, 3, 1, 1, 2, 3, 1, 5, 1, 4, 1, 2, 8, 1, 3, 1, 4, 3, 5, 5, 2, 17, 3, 4, 3, 21, 2, 1, 5, 8, 10, 7, 4, 1, 12, 3, 1, 3, 1, 3, 5, 8, 10, 8, 2, 4, 20, 2, 1, 11, 4, 14, 4, 3, 4, 17, 12, 2, 8, 13, 7, 1, 13, 5, 3, 5, 1, 8, 4, 13, 6, 3, 21, 10, 5, 1, 12, 7, 5, 1, 12, 3, 9, 7 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,9

COMMENTS

More than 73% of a(n) are < n/10.

Conjecture: for n>1 a(n) is always < n.

Define partial sums S(N) = sum_{i=1..N} a(i) and T(N)=sum_{i=1..N} i = A000217(N). Then as N increases S(N)/T(n) tends to 0.078.

LINKS

Pierre CAMI, Table of n, a(n) for n = 1..10000

MAPLE

A210650 := proc(n)

        for k from 1 do

                if isprime((2^k-1)*2^n-1) then

                        return k;

                elif isprime((2^k-1)*2^n+1) then

                        return k;

                elif isprime((2^k+1)*2^n-1) then

                        return k;

                elif isprime((2^k+1)*2^n+1) then

                        return k;

                end if;

        end do:

end proc: # R. J. Mathar, Apr 02 2012

MATHEMATICA

lnk[n_]:=Module[{k=1, t=2^n}, While[!AnyTrue[Flatten[{t(2^k-1)+{1, -1}, t(2^k+1)+ {1, -1}}], PrimeQ], k++]; k]; Array[lnk, 120] (* The program uses the AnyTrue function from Mathematica version 10 *) (* Harvey P. Dale, Jan 31 2015 *)

PROG

PFGW64 and SCRIPTIFY from Primeform group

Command: PFGW64 -f in.txt

in.txt file :

SCRIPT

DIM nn, 0

DIM kk

DIMS tt

OPENFILEOUT myfile, a(n).txt

LABEL loopn

SET nn, nn+1

IF nn>10000 THEN END

SET kk, 0

LABEL loopk

SET kk, kk+1

IF kk>2*nn THEN GOTO loopn

SETS tt, %d, %d, %d, %d\,; nn; kk; -1; -1

PRP 2^nn*(2^kk-1)-1, tt

IF ISPRP THEN GOTO a

IF ISPRIME THEN GOTO a

SETS tt, %d, %d, %d, %d\,; nn; kk; -1; 1

PRP 2^nn*(2^kk-1)+1, tt

IF ISPRP THEN GOTO a

IF ISPRIME THEN GOTO a

SETS tt, %d, %d, %d, %d\,; nn; kk; 1; -1

PRP 2^nn*(2^kk+1)-1, tt

IF ISPRP THEN GOTO a

IF ISPRIME THEN GOTO a

SETS tt, %d, %d, %d, %d\,; nn; kk; 1; 1

PRP 2^nn*(2^kk+1)+1, tt

IF ISPRP THEN GOTO a

IF ISPRIME THEN GOTO a

GOTO loopk

LABEL a

WRITE myfile, tt

GOTO loopn

CROSSREFS

Sequence in context: A073356 A093032 A072115 * A218754 A079948 A257657

Adjacent sequences:  A210647 A210648 A210649 * A210651 A210652 A210653

KEYWORD

nonn

AUTHOR

Pierre CAMI, Mar 27 2012

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 29 14:43 EDT 2021. Contains 346346 sequences. (Running on oeis4.)