Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A063826
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A063826 Let 1, 2, 3, 4 represent moves to the right, down, left and up; this sequence describes the movements in the Ulam Spiral. +0
13
1, 2, 3, 3, 4, 4, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4 (list; graph; listen)
OFFSET

0,2

LINKS

Harry J. Smith, Table of n, a(n) for n=0,...,1000

D. Alpern, Ulam's Spiral

Adrian J. F. Leatherland (bunyip(AT)yoyo.cc.monash.edu.au), The mysterious Ulam spiral phenomenon

FORMULA

Sequence starts with 1, 2, 3, then can be broken into groups of 8n+4 members, so if n is incremented, starting at 1, the groups follow the following pattern: 3 occurs at the beginning of the group, 4 then occurs 2n times, 1 occurs 2n+1 times, 2 occurs 2n+1 times, 3 occurs 2n+1 times; so each group has 8n+4 terms.

EXAMPLE

Breaking into the groups, we have: 1, 2, 3 n=1: 3, 4, 4, 1, 1, 1, 2, 2, 2, 3, 3, 3, n=2: 3, 4, 4, 4, 4, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3 n=3: 3, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3 and so on.

PROGRAM

(PARI) a(n)=if(n<0, 0, (sqrtint(4*n+1)+3)%4+1)

(PARI) { for (n=0, 1000, write("b063826.txt", n, " ", (sqrtint(4*n + 1) + 3)%4 + 1) ) } [From Harry J. Smith (hjsmithh(AT)sbcglobal.net), Sep 01 2009]

CROSSREFS

Cf. A000267.

Sequence in context: A049878 A038203 A096827 this_sequence A152983 A100889 A132983

Adjacent sequences: A063823 A063824 A063825 this_sequence A063827 A063828 A063829

KEYWORD

easy,nice,nonn

AUTHOR

Wai Ha Lee (Wainson(AT)hotmail.com), Aug 20 2001

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 22 20:51 EST 2009. Contains 167312 sequences.


AT&T Labs Research