Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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!)
A309755 Primes with record Euclidean distance from the origin. When starting rightwards in a grid, turn left after a prime number, if not walk straight on. 3
2, 3, 11, 29, 59, 97, 149, 151, 191, 193, 211, 223, 239, 263, 281, 307, 311, 331, 337, 593, 613, 631, 641, 653, 659, 853, 857, 877, 881, 907, 911, 967, 971, 991, 997, 1801, 1811, 1847, 1861, 1901, 1907, 2251, 2267, 2281, 2287, 2309, 2311, 2657, 2671, 2677, 3163, 3167, 3187, 3191, 3299, 3319, 3343, 3691, 3697, 3719, 3727 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Cells can contain more than one number.
This sequence differs from A309701, where the Manhattan distance is taken.
LINKS
EXAMPLE
Grid of the first 34 steps. 0 (second cell in sixth row) represents (0,0).
---
xx xx xx 31 30 29
xx xx xx 32 xx 28
xx xx xx 33 xx 27
xx xx xx 34 xx 26
xx 5/17 4/16 3/15 14 13/25
x 0/6/18 1 2 xx 12/24
xx 7/19 8/20 9/21 10/22 11/23
---
2 (2,0) is two steps away from the origin, 3 (2,1) is at a distance of sqrt(5). Next record distance is 11 (4,-1), at distance sqrt(17). Next is 29 (4,5), at distance sqrt(41).
MATHEMATICA
step[n_] := Switch[n, 0, {1, 0}, 1, {0, 1}, 2, {-1, 0}, 3, {0, -1}]; r = {0, 0}; q = 0; s={}; rm=0; Do[p = NextPrime[q]; r += step[Mod[n, 4]] * (p-q); r1 = Total @ (r^2); If[r1 > rm, rm = r1; AppendTo[s, p]]; q = p, {n, 0, 3000}]; s (* Amiram Eldar, Aug 15 2019 *)
PROG
(Python)
def prime(z):
isPrime=True
for y in range(2, int(z**0.5)+1) :
if z%y==0:
isPrime=False
break
return isPrime
m, n, g, h=[], [], [1, 0, -1, 0], [0, 1, 0, -1]
z=10000
for c in range (2, z):
if prime(c)==True:
m.append(c)
ca, cb, cc=2, 0, 0
for j in range(2, z):
if j in m:
cc=cc+1
cd, ce=g[cc%4], h[cc%4]
ca, cb=ca+cd, cb+ce
n.append([j+1, ca, cb, ((ca)**2+(cb)**2)**(0.5)])
#print (j+1, ca, cb)
v=2
for j in n:
if j[3]>v and j[0] in m:
print (j)
v=j[3]
(PARI) z=0; d=1; m=0; for (n=1, 3727, z+=d; if (isprime(n), d*=I; if (m<norm(z), m=norm(z); print1 (n ", ")))) \\ Rémy Sigrist, Aug 15 2019
CROSSREFS
Sequence in context: A176316 A181956 A237038 * A309701 A243896 A202211
KEYWORD
nonn
AUTHOR
Pieter Post, Aug 15 2019
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 August 18 23:05 EDT 2024. Contains 375284 sequences. (Running on oeis4.)