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!)
A248831 Prime sieve of the square root of 2. 5
1, 4, 1, 6, 309, 6, 8078, 1875, 69480, 66, 7, 32, 8462, 388, 87, 2764, 27350, 846, 12, 24, 6055850, 4, 999358, 41322266, 27505, 9995050, 527820605, 470, 5, 716059, 453459686, 285, 86408, 5, 87, 4508, 627995, 8968, 396546, 808, 640620, 5, 50, 502, 599, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

Algorithm: see A245770 (prime sieve of Pi).

LINKS

Manfred Scheucher, Table of n, a(n) for n = 1..431

Wikipedia, Square root of 2

Manfred Scheucher, Sage Script (Note: should also run in pure python with a few modifications)

PROG

(Python)

def sqroot(a, digits):

....a = a * (10**(2*digits))

....x_prev = 0

....x_next = 1 * (10**digits)

....while x_prev != x_next:

........x_prev = x_next

........x_next = (x_prev + (a // x_prev)) >> 1

....return x_next

def primes(n):

....sieve = [True] * n

....for i in range(3, int(n**0.5)+1, 2):

........if sieve[i]:

............sieve[i*i::2*i]=[False]*((n-i*i-1)/(2*i)+1)

....return [2] + [i for i in range(3, n, 2) if sieve[i]]

a = sqroot(2, 300)#300 digits is arbitrary - lengthen for more digits

b = primes(10000000)#make sure to scan primes up to longest term in sequence

y = str(a)

for x in b:

....if str(x) in y:

........y = y.replace(str(x), " ", 1)#replace first occurrence only

while "  " in y:

....y = y.replace("  ", " ")#replace chains of spaces with a single space

z = y.split(" ")#split terms into a list

z = filter(None, z)#remove null terms

f = map(int, z)#convert to integers

print(f)

# David Consiglio, Jr., Jan 03 2015

CROSSREFS

Cf. A002193 (square root of 2), A245770 (prime sieve of Pi), A248804 (prime sieve of e).

Sequence in context: A191714 A126150 A291056 * A227729 A096966 A140703

Adjacent sequences:  A248828 A248829 A248830 * A248832 A248833 A248834

KEYWORD

nonn,base

AUTHOR

Jared Kish, Oct 15 2014

EXTENSIONS

More terms from David Consiglio, Jr., Dec 02 2014, Jan 03 2015

More terms from Manfred Scheucher, May 25 2015

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 April 11 02:21 EDT 2021. Contains 342886 sequences. (Running on oeis4.)