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.

Showing 1-3 of 3 results.

A278113 Triangle T(n,k) = A278112(n,A000040(k)) for 1 <= k <= A278114(n), read by rows.

Original entry on oeis.org

1, 2, 1, 1, 1, 3, 2, 1, 1, 1, 1, 1, 4, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 5, 4, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 4, 3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 5, 4, 3, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, 6, 5, 4, 3, 3, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Jason Kimberley, Feb 09 2017

Keywords

Comments

This triangle consists of those columns of A278112 that have prime index.

Examples

			The first eight rows are:
  1;
  2, 1, 1, 1;
  3, 2, 1, 1, 1, 1, 1;
  4, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1;
  5, 4, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1;
  6, 4, 3, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1;
  7, 5, 4, 3, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1;
  8, 6, 5, 4, 3, 3, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1;
		

Crossrefs

Programs

  • Magma
    A278112:=func;
    A278113_row:=funcA278112(n,p):p in PrimesUpTo(2*n^2)]>;
    &cat[A278113_row(n):n in[1..8]];
  • Mathematica
    Table[Floor[n Sqrt[2/Prime@ k]], {n, 8}, {k, PrimePi[2 n^2]}] // Flatten (* Michael De Vlieger, Feb 17 2017 *)

Formula

T(n,k) = floor(n*sqrt(2/prime(k))).
T(n,k) sqrt(A000040(k)) <= n sqrt(2) < (T(n,k)+1) sqrt(A000040(k)).

A278116 a(n) is the largest j such that A278115(n,k) strictly decreases for k=1..j.

Original entry on oeis.org

1, 2, 3, 3, 4, 3, 2, 2, 5, 4, 4, 2, 2, 3, 3, 5, 3, 2, 2, 4, 3, 3, 2, 2, 3, 4, 6, 6, 2, 3, 4, 3, 3, 2, 2, 3, 5, 4, 4, 2, 4, 3, 4, 3, 2, 2, 3, 4, 3, 2, 2, 4, 3, 4, 3, 2, 2, 3, 4, 3, 2, 2, 3, 3, 5, 3, 2, 2, 4, 5, 4, 2, 2, 3, 3, 4, 3, 2, 3, 4, 7, 5, 2, 2, 3, 4, 2, 2, 2, 3, 5, 5, 5, 2, 2, 3, 4, 3, 2, 2, 4, 5, 3, 3, 2
Offset: 1

Views

Author

Jason Kimberley, Feb 12 2017

Keywords

Crossrefs

Cf. A278102.
This is the row length sequence for triangles A278117 and A278118.
A278119 lists first occurrences in this sequence.

Programs

  • Magma
    A:=func;
    A278116:=funcA278115(n,P[j+1])}
      select j else #P) where P is PrimesUpTo(2*n^2)>;
    [A278116(n):n in[1..103]];
    
  • Mathematica
    Map[1 + Length@ TakeWhile[Differences@ #, # < 0 &] &, #] &@ Table[# Floor[n Sqrt[2/#]]^2 &@ Prime@ k, {n, 105}, {k, PrimePi[2 n^2]}] (* Michael De Vlieger, Feb 17 2017 *)
  • Python
    def isqrt(n):
        if n < 0:
            raise ValueError('imaginary')
        if n == 0:
            return 0
        a, b = divmod(n.bit_length(),2)
        x = 2**(a+b)
        while True:
            y = (x + n//x)//2
            if y >= x:
                return x
            x = y;
    def next_prime(n):
        for p in range(n+1,2*n+1):
            for i in range(2,isqrt(n)+1):
                if p % i == 0:
                    break
            else:
                return p
        return None
    def A278116(n):
        k = 0
        p = 2
        s2= (n**2)*p
        s = s2
        while True:
            s_= s
            k+= 1
            p = next_prime(p)
            s = (isqrt(s2//p)**2)*p
            if s > s_:
                break
        return k

A278117 Irregular triangle T(n,k) = A278115(n,k) for 1 <= k <= A278116(n), read by rows.

Original entry on oeis.org

2, 8, 3, 18, 12, 5, 32, 27, 20, 50, 48, 45, 28, 72, 48, 45, 98, 75, 128, 108, 162, 147, 125, 112, 99, 200, 192, 180, 175, 242, 192, 180, 175, 288, 243, 338, 300, 392, 363, 320, 450, 432, 405, 512, 507, 500, 448, 396, 578, 507, 500, 648, 588, 722, 675, 800, 768, 720
Offset: 1

Views

Author

Jason Kimberley, Feb 12 2017

Keywords

Comments

Each row is the longest strictly decreasing prefix of the corresponding row of A278115.

Examples

			The first six rows are:
2;
8, 3;
18, 12, 5;
32, 27, 20;
50, 48, 45, 28;
72, 48, 45;
		

Crossrefs

Programs

  • Magma
    A278112:=func;
    A278115_row:=funcA278112(n,p)^2*p:p in PrimesUpTo(2*n^2)]>;
    A278117_row:=funcA278115_row(n) >;
    &cat[A278117_row(n):n in[1..20]];
  • Mathematica
    Map[Take[#, 1 + Length@ TakeWhile[Differences@ #, # < 0 &]] &, #] &@ Table[# Floor[n Sqrt[2/#]]^2 &@ Prime@ k, {n, 20}, {k, PrimePi[2 n^2]}] // Flatten (* Michael De Vlieger, Feb 17 2017 *)
Showing 1-3 of 3 results.