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.

User: Christopher J. Shore

Christopher J. Shore's wiki page.

Christopher J. Shore has authored 3 sequences.

A329267 a(n) is the absolute difference between n and its nearest palindromic neighbor.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 5, 4, 3, 2
Offset: 0

Author

Christopher J. Shore, Nov 09 2019

Keywords

Comments

Empirical observation: this sequence is similar to A261424 but yields the absolute difference between n and its nearest palindromic neighbor. It answers the question "How far from this number is the nearest palindrome?"

Examples

			For 0 <= n <= 9, n is palindromic so a(n) = 0.
a(10) = 10-9 = 11-10 = 1 (10 is equidistant from its two nearest palindromes).
a(11) = 0 because 11 is palindromic.
For 12 <= n <= 16, a(n) = n-11 because 11 is the nearest palindromic number.
For 17 <= n <= 22, a(n) = 22-n because 22 is the nearest palindromic number.
.
   n  nearest palindrome  difference
  --  ------------------  ----------
   1           1            1-1 = 0
   2           2            2-2 = 0
   3           3            3-3 = 0
   4           4            4-4 = 0
   5           5            5-5 = 0
   6           6            6-6 = 0
   7           7            7-7 = 0
   8           8            8-8 = 0
   9           9            9-9 = 0
  10        9 or 11     10-9 = 11-10 = 1
  11          11           11-11 = 0
  12          11           12-11 = 1
  13          11           13-11 = 2
  14          11           14-11 = 3
  15          11           15-11 = 4
  16          11           16-11 = 5
  17          22           22-17 = 5
  18          22           22-18 = 4
  19          22           22-19 = 3
  20          22           22-20 = 2
  21          22           22-21 = 1
  22          22           22-22 = 0
  23          22           23-22 = 1
		

Crossrefs

Programs

  • Mathematica
    palQ[n_] := Block[{d = IntegerDigits[n]}, d == Reverse@ d]; a[n_] := Block[{k=0}, While[! palQ[n+k] && ! palQ[n-k], k++]; k]; Array[a, 121] (* Giovanni Resta, Nov 12 2019 *)
  • PARI
    ispal(n) = my (d=digits(n)); d==Vecrev(d)
    a(n) = for (k=0, oo, if (ispal(n-k) || ispal(n+k), return (k))) \\ Rémy Sigrist, Dec 03 2019

A272459 The total number of different isosceles trapezoids, excluding squares, that can be drawn on an n X n square grid where the corners of each individual trapezoid lie on a lattice point.

Original entry on oeis.org

0, 1, 7, 18, 40, 71, 119, 180, 264, 365, 495, 646, 832, 1043, 1295, 1576, 1904, 2265, 2679, 3130, 3640, 4191, 4807, 5468, 6200, 6981, 7839, 8750, 9744, 10795, 11935, 13136, 14432, 15793, 17255, 18786, 20424, 22135, 23959, 25860, 27880, 29981, 32207, 34518
Offset: 1

Author

Christopher J. Shore, Apr 29 2016

Keywords

Comments

This is an observation from a high school mathematics investigation: How many different isosceles trapezoids can be drawn on an n X n grid such that the corners of each individual trapezoid lie on a lattice point? The sequence gives the total number of different trapezoids that can be drawn.
There are two "families" or types of trapezoids that can be drawn on a grid. The first is where the parallel sides are drawn horizontally on the grid. The second is where the parallel sides are drawn diagonally with a gradient of 1. The number in each type follow a pattern.
1 X 1 grid: No trapezoids of either type can be drawn.
2 X 2 grid: 1 trapezoid of type 2. One parallel side is drawn diagonally through 1 square (having length sqrt(2)) and the other is drawn diagonally through two squares (length 2*sqrt(2)). Thus, the non-parallel sides are drawn horizontally or vertically to join between the parallel sides (each length 1).
3 X 3 grid: 3 trapezoids of type 1 and 4 trapezoids of type 2. The 3 trapezoids of type 1 are constructed by one parallel line drawn horizontally with length 3, the other parallel line drawn with length 1 and the perpendicular heights being successively 1, 2 and 3. Type-2 trapezoids are constructed in the same way as outlined above but with varying lengths and heights.
4 X 4 grid: 8 type-1 trapezoids and 10 type-2 trapezoids.
5 X 5 grid: 20 type-1 trapezoids and 20 type-2 trapezoids.
Hence the pattern is as follows:
Type 1 Type 2 Total
1 X 1 grid 0 0 0
2 X 2 grid 0 1 1
3 X 3 grid 3 4 7
4 X 4 grid 8 10 18
5 X 5 grid 20 20 40
6 X 6 grid 36 35 71
7 X 7 grid 63 56 119

Crossrefs

Programs

  • Magma
    [(n*(-1-3*(-1)^n-12*n+10*n^2))/24 : n in [1..60]]; // Wesley Ivan Hurt, Sep 12 2016
  • Maple
    A272459:=n->(n*(-1-3*(-1)^n-12*n+10*n^2))/24: seq(A272459(n), n=1..60); # Wesley Ivan Hurt, Sep 12 2016
  • Mathematica
    CoefficientList[Series[x^2 (1 + 5 x + 3 x^2 + x^3)/((1 - x)^4 (1 + x)^2), {x, 0, 44}], x] (* Michael De Vlieger, May 08 2016 *)
  • PARI
    concat(0, Vec(x^2*(1+5*x+3*x^2+x^3)/((1-x)^4*(1+x)^2) + O(x^50))) \\ Colin Barker, May 07 2016
    

Formula

a(n) = Sum_{k=0..n} A032438(k) + A000292(n-1). (conjectured)
a(n) = A143785(n-2) + A000292(n-1). (conjectured)
From Colin Barker, May 07 2016: (Start)
a(n) = (n*(-1 - 3*(-1)^n - 12*n + 10*n^2))/24.
a(n) = (5*n^3 - 6*n^2 - 2*n)/12 for n even.
a(n) = (5*n^3 - 6*n^2 + n)/12 for n odd.
a(n) = 2*a(n-1) + a(n-2) - 4*a(n-3) + a(n-4) + 2*a(n-5) - a(n-6) for n>6.
G.f.: x^2*(1+5*x+3*x^2+x^3) / ((1-x)^4*(1+x)^2).
(End)

A265384 Toothpick sequence starting at the vertex of y=3*abs(x).

Original entry on oeis.org

1, 2, 3, 5, 7, 9, 11, 13, 17, 21, 23, 25, 27, 31, 35, 39, 43, 47, 55, 63, 65, 67, 69, 73, 77, 81, 85, 89, 97, 105, 109, 113, 117, 125, 133, 141, 149, 157, 173, 189, 191, 193, 195, 199, 203, 207, 211, 215, 223, 231, 235, 239, 243, 251, 259, 267, 275, 283, 299, 315, 319, 323, 327, 335, 343, 351, 359, 367, 383, 399, 407, 415, 423, 439, 455, 471, 487, 503, 535, 567
Offset: 1

Author

Christopher J. Shore, Dec 07 2015

Keywords

Comments

Consider the graph y=3*abs(x). The first toothpick extends vertically from (0,0) to (0,2). Each toothpick is of length 2 and is laid either horizontally or vertically.
Subsequent toothpicks are placed in a similar rule as A139250. Place toothpicks by the following rules:
- Toothpicks must always stay inside the graph of y=3*abs(x).
- Call the end of a toothpick exposed if it does not touch another toothpick, or the line y=3*abs(x)
- Each horizontal toothpick has its midpoint touching an exposed vertical toothpick
- If no horizontal toothpick can be laid, then a vertical toothpick should be laid on any exposed ends, from its end.
The sequence is the number of toothpicks laid after n rounds.
The structure is essentially the same as the Sierpinski's triangle but here every equilateral triangle is replaced with an isosceles triangle and then every isosceles triangle is replaced with seven toothpicks. There are infinitely many sequences of this type. - Omar E. Pol, Mar 12 2016

Examples

			The pattern is the total number of toothpicks laid after n rounds.
Following the rules above, the first round has 1 toothpick, the second and third rounds also have 1 toothpick, but the fourth and fifth round both have 2 toothpicks. Finding the total toothpicks placed in this pattern (1,1,1,2,2) gives 1,2,3,5,7. Subsequent rounds have this same pattern repeated from the emerging branches thus:
(1,1,1,2,2) ---> 1,2,3,5,7
2*(1,1,1,2,2) ---> 9,11,13,17,21
2*((1,1,1,2,2),2*(1,1,1,2,2)) ---> 23,25,27,31,35,39,43,47,55,63
2*((1,1,1,2,2),2*(1,1,1,2,2),2*((1,1,1,2,2),2*(1,1,1,2,2))) ---> 65,67,69,73,77,81,85,89,97,105,109,113,117,125,133,141,149,157,173,189
Summation of 1*the sequence 1,1,1,2,2
  (1)=1
1+(1)=2
2+(1)=3
3+(2)=5
5+(2)=7
Summation of 2*the sequence 1,1,1,2,2
7+2(1)=9
9+2(1)=11
11+2(1)=13
13+2(2)=17
17+2(2)=21
Summation of 3*the sequence 1,1,1,2,2
21+2(1)=23
23+2(1)=25
25+2(1)=27
27+2(2)=31
31+2(2)=35
		

Crossrefs