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.

A138152 Triangular sequence: a(n, m) = a(n - 1, m) + 10 and a(n,m) + 2*ceiling(log(1+k)), k <= n.

Original entry on oeis.org

3, 7, 11, 13, 17, 19, 23, 29, 31, 31, 37, 41, 41, 43, 47, 53, 59, 61, 61, 67, 71, 71, 73, 79, 83, 83, 89, 97, 101, 103, 101, 103, 107, 109, 113, 113, 127, 131, 131, 137, 139, 149, 151, 151, 157, 163, 163, 167, 173, 173, 179, 181, 181, 191, 193, 197, 199
Offset: 1

Views

Author

Roger L. Bagula, May 04 2008

Keywords

Comments

Row sums: {10, 60, 83, 109, 131, 173, 199, 306, 172, 301, 533, 113, 258, 407, 300, 471, 503, 533, 181, 780, ...}.
The procedure is based on the modulo-10 prime ending set {1,3,7,9} and leaves out {2,5} at the start. To n=20 the precedure produces all the primes except {2,5}. It also classifies primes by the length of the longest vector in which they appear.

Examples

			Rows begin
    3,   7;
   11,  13,  17,  19;
   23,  29,  31;
   31,  37,  41;
   41,  43,  47;
   53,  59,  61;
   61,  67,  71;
   71,  73,  79,  83;
   83,  89;
   97, 101, 103;
  101, 103, 107, 109, 113;
  113;
  127, 131;
  131, 137, 139;
  149, 151;
  151, 157, 163;
  163, 167, 173;
  173, 179, 181;
  181;
  191, 193, 197, 199;
		

Programs

  • Mathematica
    a[0, 0] = 0; a[0, 1] = 1; a[0, 2] = 3; a[0, 3] = 7; a[0, 4] = 9; a[n_, m_] := a[n, m] = a[n - 1, m] + 10; a0 = Table[Union[Flatten[Table[If[PrimeQ[a[n, m]] && PrimeQ[a[n, m] + 2*k], {a[n, m], a[n, m] + 2*k}, {}], {m, 0, 4}, {k, 0, Ceiling[Log[1 +n]]}]]], {n, 0, 20}]; Flatten[a0]

Formula

a(0, m) = {0,1,3,7,9};
a(n, m) = a(n-1, m) + 10;
a(n, m) = If( prime,{a(n,m),a(n,m)+2*ceiling(log(1+k)),k <= n).