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.

A154722 Triangle read by rows in which row n lists: n, in the center of the row and the pairs of noncomposite numbers that are equidistant to n, as shown below in the example.

Original entry on oeis.org

1, 1, 2, 3, 1, 3, 5, 1, 3, 4, 5, 7, 3, 5, 7, 1, 5, 6, 7, 11, 1, 3, 7, 11, 13, 3, 5, 8, 11, 13, 1, 5, 7, 9, 11, 13, 17, 1, 3, 7, 10, 13, 17, 19, 3, 5, 11, 17, 19, 1, 5, 7, 11, 12, 13, 17, 19, 23, 3, 7, 13, 19, 23, 5, 11, 14, 17, 23, 1, 7, 11, 13, 15
Offset: 1

Views

Author

Omar E. Pol, Jan 14 2009

Keywords

Examples

			Triangle begins:
. . . . . . . . . . . . . . .1
. . . . . . . . . . . . . 1, 2, 3
. . . . . . . . . . . .1, .. 3, .. 5
. . . . . . . . . . 1, .. 3, 4, 5, .. 7
. . . . . . . . ... .. 3, .. 5, .. 7, .. .
. . . . . . . 1, .. .. .. 5, 6, 7, .. .. .,11
. . . . . .1, .. 3, .. .. .. 7, .. .. ..11, ..13
. . . . .. .. 3, .. 5, .. .. 8, .. ..11, ..13, .. .
. . .1, .. .. .. 5, .. 7, .. 9, ..11, ..13, .. .. ..17
. 1, .. 3, .. .. .. 7, .. .,10, .. ..13, .. .. ..17, ..19
		

Crossrefs

Programs

  • Maple
    isnotcomp:=proc(n)return (n=1 or isprime(n)) end:
    for n from 1 to 10 do for k from 1 to 2*n-1 do if(k=n or (isnotcomp(k) and isnotcomp(2*n-k)))then print(k):fi:od:od: # Nathaniel Johnston, Apr 18 2011
  • Mathematica
    Select[Flatten@Table[If[k == n  || ! CompositeQ[k] && ! CompositeQ[2 n - k], k, 0], {n, 10}, {k, 2 n - 1}], # > 0 &]  (* Robert Price, Apr 26 2025 *)

Extensions

a(45) - a(73) from Nathaniel Johnston, Apr 18 2011