login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A059661 Like A059459, but each term must be greater than the previous ones. 6
2, 3, 7, 23, 31, 4127, 4159, 20543, 134238271, 134238527, 167792959, 1241534783, 3389018431, 72108495167, 72108503359, 72108765503, 2722258935367507707706996859526254457151, 2722258935367507707708149781030861304127, 13611294676837538538536137218847444070719 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
FORMULA
a(n) = 2 + Sum_{k=1..n-1} 2^A059662(k). - Pontus von Brömssen, Jan 07 2023
MAPLE
flip_primes_asc_search := proc(a, upto_bit, upto_length) local i, n, t; if(nops(a) >= upto_length) then RETURN(a); fi; t := a[nops(a)]; for i from 0 to upto_bit do n := XORnos(t, (2^i)); if(isprime(n) and (n > t)) then print([op(a), n]); RETURN(flip_primes_asc_search([op(a), n], upto_bit, upto_length)); fi; od; RETURN([op(a), `and no more`]); end;
flip_primes_asc_search([2], 512, 21);
MATHEMATICA
uptobit = 512; uptolength = 17; Clear[f]; f[a_] := f[a] = Module[{n, i, t}, If[Length[a] >= uptolength, Return[a]]; t = a[[-1]]; For[i = 0, i <= uptobit, i++, n = BitXor[t, 2^i]; If[PrimeQ[n] && n > t, Return[f[Append[ a, n]]]]]]; A059661 = f[{2}] (* Jean-François Alcover, Mar 07 2016, adapted from Maple *)
PROG
(Python)
from sympy import isprime
from itertools import islice
def agen():
an, bit = 2, 1
while True:
yield an
while an&bit or not isprime(an+bit): bit <<= 1
an += bit; bit = 1
print(list(islice(agen(), 17))) # Michael S. Branicky, Oct 01 2022
CROSSREFS
Sequence in context: A278477 A118883 A061712 * A214704 A231075 A072686
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Feb 03 2001
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 20 00:26 EDT 2024. Contains 371798 sequences. (Running on oeis4.)