Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A129956
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A129956 L1 ('city-block') distances from the origin to a 2D random walk based on the digits of pi. +0
1
5, 9, 4, 5, 6, 4, 5, 8, 4, 7, 11, 13, 13, 18, 13, 17, 15, 15, 18, 20, 15, 21, 24, 25, 22, 18, 22, 19, 21, 25, 25, 27, 30, 29, 25, 28, 32, 34, 36, 35, 36, 40, 48, 47, 53, 55, 57, 57, 64, 63, 64, 65, 61, 53, 54, 52, 46, 45, 39, 41, 48, 54, 58, 56, 47, 47, 42, 48, 47, 41, 38, 36, 41 (list; graph; listen)
OFFSET

1,1

COMMENT

The distance from the starting point has physical applications, eg, in aggregation models.

All distance metrics generate sequences which coincide at the zero points. The L1 (city-block) metric is the simplest, and is intrinsically integer valued on integer-spaced lattices (as used here).

The r sequence is not affected by the dimension ordering (i.e. whether each pair of values taken from the digits of pi represents [x,y] or [y,x]).

LINKS

Hemphill, Scott, Pi (gives 1.25 million digits of pi)

Eric Weisstein's World of Mathematics, Pi Digits.

FORMULA

r(n) = abs(cx(n)) + abs(cy(n)), where cx = cum_sum([odd digits of pi] - 4.5), and cy = cum_sum([even digits of pi] - 4.5).

EXAMPLE

The first 10 digits of pi are: 3 1 4 1 5 9 2 6 5 3

This gives five 2-tuples (x,y pairs): [3 1], [4 1], [5 9], [2 6], [5 3]

The x & y vectors are: x = [3 4 5 2 5], y = [1 1 9 6 3]

Adjusting to zero mean gives: x = [ -1.5 -0.5 0.5 -2.5 0.5], y = [ -3.5 -3.5 4.5 1.5 -1.5]

The cumulative x,y position vectors are: cx = [ -1.5 -2 -1.5 -4 -3.5], cy = [ -3.5 -7 -2.5 -1 -3.5]

The L1 radii from the origin are: r = abs(cx) + abs(cy), r = [5 9 4 5 6]

PROGRAM

(Matlab) function r = find_L1_radius(pidigits, k); d = pidigits(1:2*k); t = reshape(d, 2, length(d)/2); x = t(1, :); y = t(2, :); cx = cumsum(x - 4.5); cy = cumsum(y - 4.5); r = abs(cx) + abs(cy); return; % pidigits is a Matlab row vector of at least 2*k digits of pi (including the initial '3'); % k is the number of 2D radii to calculate.

CROSSREFS

Sequence in context: A111698 A021948 A111453 this_sequence A010774 A021631 A135169

Adjacent sequences: A129953 A129954 A129955 this_sequence A129957 A129958 A129959

KEYWORD

nonn

AUTHOR

Ross Drewe (rd(AT)labyrinth.net.au), Jun 10 2007, Jun 11 2007

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 August 29 17:54 EDT 2008. Contains 143238 sequences.


AT&T Labs Research