cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A211000 Coordinates (x,y) of the endpoint of a structure (or curve) formed by Q-toothpicks in which the inflection points are the prime numbers A000040.

This page as a plain text file.
%I A211000 #84 Oct 01 2022 21:13:55
%S A211000 0,0,1,1,2,0,3,-1,4,-2,3,-3,2,-4,3,-5,4,-6,3,-7,2,-6,3,-5,4,-4,3,-3,2,
%T A211000 -2,3,-1,4,-2,3,-3,2,-4,3,-5,4,-6,3,-7,2,-6,3,-5,4,-4,3,-3,2,-4,3,-5,
%U A211000 4,-4,3,-3,2,-2,3,-1,4,0,3,1,2,0,3,-1,4,0
%N A211000 Coordinates (x,y) of the endpoint of a structure (or curve) formed by Q-toothpicks in which the inflection points are the prime numbers A000040.
%C A211000 On the infinite square grid the structure looks like a column of tangent circles of radius 1. The structure arises from the prime numbers A000040. The behavior seems to be as modular arithmetic but in a growing structure. The values on the axis "x" are easy to predict (see A211010). On the other hand the values on the axis "y" do not seem to be predictable (see A211011). This is a member of the family of the structures or curves mentioned in A210838. The odd numbers > 1 are located on the main axis of the structure. Note that here the Q-toothpicks can be superposed. For the definition of Q-toothpicks see A187210. A211021 gives the number of stage where a new circle appears in the structure. For the number of circles after the n-th stage see A211020. For the location of the centers of the circles see A211022. For the sums of the visible nodes after the n-th stage see A211024.
%H A211000 Paolo Xausa, <a href="/A211000/b211000.txt">Table of n, a(n) for n = 0..9999</a>
%H A211000 N. J. A. Sloane, <a href="/wiki/Catalog_of_Toothpick_and_CA_Sequences_in_OEIS">Catalog of Toothpick and Cellular Automata Sequences in the OEIS</a>
%H A211000 <a href="/index/To#toothpick">Index entries for sequences related to toothpick sequences</a>
%e A211000 We start at stage 0 with no Q-toothpicks.
%e A211000 At stage 1 we place a Q-toothpick centered at (1,0) with its endpoints at (0,0) and (1,1).
%e A211000 At stage 2 we place a Q-toothpick centered at (1,0) with its endpoints at (1,1) and (2,0). Since 2 is a prime number we have that the end of the curve is also an inflection point.
%e A211000 At stage 3 we place a Q-toothpick centered at (3,0) with its endpoints at (2,0) and (3,-1). Since 3 is a prime number we have that the end of the curve is also an inflection point.
%e A211000 At stage 4 we place a Q-toothpick centered at (3,-2) with its endpoints at (3,-1) and (4,-2).
%e A211000 -------------------------------------
%e A211000 .                    The end as
%e A211000 .          Pair      inflection
%e A211000 n        (x    y)      point
%e A211000 -------------------------------
%e A211000 0         0,   0,        -
%e A211000 1         1,   1,        -
%e A211000 2         2,   0,       Yes
%e A211000 3         3,  -1,       Yes
%e A211000 4         4,  -2,        -
%e A211000 5         3,  -3,       Yes
%e A211000 6         2,  -4,        -
%e A211000 7         3,  -5,       Yes
%e A211000 8         4,  -6,        -
%e A211000 9         3,  -7,        -
%e A211000 10        2,  -6,        -
%e A211000 11        3,  -5,       Yes
%e A211000 ...
%e A211000 Illustration of the nodes of the structure:
%e A211000 -----------------------------------------------------
%e A211000 After 9 stages    After 10 stages    After 11 stages
%e A211000 -----------------------------------------------------
%e A211000 .
%e A211000 .    1                 1                  1
%e A211000 .  0   2             0   2              0   2
%e A211000 .        3                 3                  3
%e A211000 .          4                 4                  4
%e A211000 .        5                 5                  5
%e A211000 .      6                 6                  6
%e A211000 .        7                 7                 11
%e A211000 .          8            10   8             10   8
%e A211000 .        9                 9                  9
%e A211000 .
%t A211000 A211000[nmax_]:=Module[{walk={{0,0}},angle=3/4Pi,turn=Pi/2},Do[If[!PrimeQ[n],If[n>5&&PrimeQ[n-1],turn*=-1];angle-=turn];AppendTo[walk,AngleVector[Last[walk],{Sqrt[2],angle}]],{n,0,nmax-1}];walk];
%t A211000 A211000[100] (* Generates 101 coordinate pairs *) (* _Paolo Xausa_, Aug 23 2022 *)
%o A211000 (PARI)
%o A211000 A211000(nmax) = my(walk=vector(nmax+1), turn=1, p1, p2); walk[1]=[0,0];if(nmax==0,return(walk));walk[2]=[1,1];for(n=1, nmax-1, p1=walk[n];p2=walk[n+1];if(isprime(n),walk[n+2]=[2*p2[1]-p1[1],2*p2[2]-p1[2]],if(n>5 && isprime(n-1), turn*=-1);walk[n+2]=[p2[1]-turn*(p1[2]-p2[2]),p2[2]+turn*(p1[1]-p2[1])]));walk;
%o A211000 A211000(100) \\ Generates 101 coordinate pairs - _Paolo Xausa_, Sep 22 2022
%o A211000 (Python)
%o A211000 from sympy import isprime
%o A211000 def A211000(nmax):
%o A211000     walk, turn = [(0,0),(1,1)], 1
%o A211000     for n in range(1,nmax):
%o A211000         p1, p2 = walk[-2], walk[-1]
%o A211000         if isprime(n): # Go straight
%o A211000             walk.append((2*p2[0]-p1[0],2*p2[1]-p1[1]))
%o A211000         else:          # Turn
%o A211000             if n>5 and isprime(n-1): turn *= -1
%o A211000             walk.append((p2[0]-turn*(p1[1]-p2[1]),p2[1]+turn*(p1[0]-p2[0])))
%o A211000     return walk[:nmax+1]
%o A211000 print(A211000(100)) # Generates 101 coordinate pairs - _Paolo Xausa_, Sep 22 2022
%Y A211000 Bisections: A211010, A211011.
%Y A211000 Cf. A187210, A210838, A210841, A211001-A211003, A211020-A211024, A355478, A357434.
%K A211000 sign,look
%O A211000 0,5
%A A211000 _Omar E. Pol_, Mar 30 2012