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.

A210838 Coordinates (x,y) of the endpoint of a structure (or curve) formed by Q-toothpicks of size = 1..n. The inflection points are the n-th nodes if n is a triangular number A000217.

This page as a plain text file.
%I A210838 #78 Feb 05 2023 13:48:33
%S A210838 0,0,1,1,3,3,0,6,-4,10,1,15,7,9,14,2,22,10,13,19,3,9,-8,-2,-20,10,-7,
%T A210838 23,7,9,-8,-6,-24,-22,-7,-39,11,-21,-8,-2,-28,-22,-7,-43,15,-65,-8,
%U A210838 -88,-32,-64,-7,-39,19,-65,-8,-92,-36,-64,-65,-35,-95,-65,-64,-96
%N A210838 Coordinates (x,y) of the endpoint of a structure (or curve) formed by Q-toothpicks of size = 1..n. The inflection points are the n-th nodes if n is a triangular number A000217.
%C A210838 It appears there is an infinite family of this type of curves or structures in which the terms of a sequence of positive integers are represented as inflection points and the gaps between them are essentially represented as nodes of spirals. For example: consider a structure formed by Q-toothpicks of size = Axxxxxa connected by their endpoints in which the inflection points are the exposed endpoints at stage Axxxxxb(n), where both Axxxxxa and Axxxxxb are sequences with positive integers. Also instead of Q-toothpicks we can use semicircumferences or also 3/4 of circumferences. For the definition of Q-toothpicks see A187210.
%C A210838 We start at stage 0 with no Q-toothpicks.
%C A210838 At stage 1 we place a Q-toothpick of size 1 centered at (1,0) with its endpoints at (0,0) and (1,1). Since 1 is a positive triangular number we have that the end of the curve is also an inflection point.
%C A210838 At stage 2 we place a Q-toothpick of size 2 centered at (1,3) with its endpoints at (1,1) and (3,3).
%C A210838 At stage 3 we place a Q-toothpick of size 3 centered at (0,3) with its endpoints at (3,3) and (0,6). Since 3 is a positive triangular number we have that the end of the curve is also an inflection point.
%C A210838 At stage 4 we place a Q-toothpick of size 4 centered at (0,10) with its endpoints at (0,6) and (-4,10).
%C A210838 And so on...
%H A210838 Paolo Xausa, <a href="/A210838/b210838.txt">Table of n, a(n) for n = 0..9999</a>
%H A210838 N. J. A. Sloane, <a href="http://oeis.org/wiki/Catalog_of_Toothpick_and_CA_Sequences_in_OEIS">Catalog of Toothpick and Cellular Automata Sequences in the OEIS</a>
%H A210838 Paolo Xausa, <a href="/A210838/a210838_2.gif">Animation of terms n = 0..41 (first 21 coordinate pairs)</a>, where orange dots are toothpick endpoints (hollow dots are inflection points) and blue dots are toothpick centers
%H A210838 Paolo Xausa, <a href="/A210838/a210838_1.gif">Animation of terms n = 0..507 (first 254 coordinate pairs)</a>
%H A210838 Paolo Xausa, <a href="/A210838/a210838.png">Scatterplot of 10^5 coordinate pairs</a>
%H A210838 <a href="/index/To#toothpick">Index entries for sequences related to toothpick sequences</a>
%e A210838 -------------------------------------
%e A210838 Stage n also              The end as
%e A210838 the size of     Pair      inflection
%e A210838 Q-toothpick   (x    y)      point
%e A210838 -------------------------------------
%e A210838 .    0         0,   0,        -
%e A210838 .    1         1,   1,       Yes
%e A210838 .    2         3,   3,        -
%e A210838 .    3         0,   6,       Yes
%e A210838 .    4        -4,  10,        -
%e A210838 .    5         1,  15,        -
%e A210838 .    6         7,   9,       Yes
%e A210838 .    7        14,   2,        -
%e A210838 .    8        22,  10,        -
%e A210838 .    9        13,  19,        -
%e A210838 .   10         3,   9,       Yes
%e A210838 .   11        -8,  -2,        -
%e A210838 .   12       -20,  10,        -
%e A210838 .   13        -7,  23,        -
%e A210838 .   14         7,   9,        -
%e A210838 .   15        -8,  -6,       Yes
%t A210838 A210838[nmax_]:=Module[{ep={0, 0}, angle=3/4Pi, turn=Pi/2, infl=0}, Join[{ep}, Table[If[n>1&&IntegerQ[Sqrt[8(n-1)+1]], infl++, If[Mod[infl, 2]==1, turn*=-1]; angle-=turn; infl=0]; ep=AngleVector[ep, {Sqrt[2]n, angle}], {n, nmax}]]];
%t A210838 A210838[100] (* Generates 101 coordinate pairs *) (* _Paolo Xausa_, Jan 12 2023 *)
%o A210838 (PARI)
%o A210838 A210838(nmax) = my(ep=vector(nmax+1), turn=1, infl=0, ep1, ep2); ep[1]=[0, 0]; if(nmax==0, return(ep)); ep[2]=[1, 1]; for(n=2, nmax, ep1=ep[n-1]; ep2=ep[n]; if(issquare((n-1)<<3+1), infl++; ep[n+1]=[ep2[1]+n*sign(ep2[1]-ep1[1]), ep2[2]+n*sign(ep2[2]-ep1[2])], if(infl%2, turn*=-1); infl=0; ep[n+1]=[ep2[1]-turn*n*sign(ep1[2]-ep2[2]), ep2[2]+turn*n*sign(ep1[1]-ep2[1])])); ep;
%o A210838 A210838(100) \\ Generates 101 coordinate pairs - _Paolo Xausa_, Jan 12 2023
%o A210838 (Python)
%o A210838 from numpy import sign
%o A210838 from sympy import integer_nthroot
%o A210838 def A210838(nmax):
%o A210838     ep, turn, infl = [(0, 0), (1, 1)], 1, 0
%o A210838     for n in range(2, nmax + 1):
%o A210838         ep1, ep2 = ep[-2], ep[-1]
%o A210838         if integer_nthroot(((n - 1) << 3) + 1, 2)[1]: # Continue straight
%o A210838             infl += 1
%o A210838             dx = n * sign(ep2[0] - ep1[0])
%o A210838             dy = n * sign(ep2[1] - ep1[1])
%o A210838         else: # Turn
%o A210838             if infl % 2: turn *= -1
%o A210838             infl = 0
%o A210838             dx = turn * n * sign(ep2[1] - ep1[1])
%o A210838             dy = turn * n * sign(ep1[0] - ep2[0])
%o A210838         ep.append((ep2[0] + dx, ep2[1] + dy))
%o A210838     return ep[:nmax+1]
%o A210838 print(A210838(100)) # Generates 101 coordinate pairs - _Paolo Xausa_, Jan 12 2023
%Y A210838 Cf. A210841 (the same idea for primes).
%Y A210838 Cf. A000217, A005132, A187210, A210606, A211000, A211011.
%K A210838 sign,look,hear
%O A210838 0,5
%A A210838 _Omar E. Pol_, Mar 28 2012
%E A210838 a(30)-a(33) corrected and more terms by _Paolo Xausa_, Jan 12 2023