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.

A201539 T(n,k)=Number of nXk 0..2 arrays with rows and columns lexicographically nondecreasing and every element equal to at least one horizontal or vertical neighbor.

Original entry on oeis.org

0, 3, 3, 3, 9, 3, 6, 25, 25, 6, 9, 69, 111, 69, 9, 13, 175, 633, 633, 175, 13, 18, 410, 3354, 7799, 3354, 410, 18, 24, 899, 16393, 91425, 91425, 16393, 899, 24, 31, 1859, 72811, 983981, 2446147, 983981, 72811, 1859, 31, 39, 3649, 293831, 9526987, 61807736
Offset: 1

Views

Author

R. H. Hardin Dec 02 2011

Keywords

Comments

Table starts
..0....3.......3..........6.............9..............13...............18
..3....9......25.........69...........175.............410..............899
..3...25.....111........633..........3354...........16393............72811
..6...69.....633.......7799.........91425..........983981..........9526987
..9..175....3354......91425.......2446147........61807736.......1408677515
.13..410...16393.....983981......61807736......3762507339.....208164634003
.18..899...72811....9526987....1408677515....208164634003...28456420346436
.24.1859..293831...82847704...28646055184..10298954399450.3505159734744220
.31.3649.1087857..652848538..523398227137.457194210355549
.39.6840.3735546.4712696751.8686880778087

Examples

			Some solutions for n=3 k=7
..0..0..0..1..1..2..2....0..1..1..1..2..2..2....0..0..0..1..1..2..2
..0..0..1..0..0..1..2....0..1..1..2..0..0..2....0..0..2..2..2..2..2
..0..1..1..0..1..1..2....2..2..2..2..0..1..1....1..1..1..1..2..1..1
		

Crossrefs

Column 1 is A167614(n-3)

A228446 a(n) = smallest prime p such that 2*n+1 = p + x*(x+1) for some positive integer x, or -1 if no such prime exists.

Original entry on oeis.org

3, 5, 3, 5, 7, 3, 5, 7, 19, 3, 5, 7, 17, 11, 3, 5, 7, 19, 11, 13, 3, 5, 7, 31, 11, 13, 37, 3, 5, 7, 23, 11, 13, 29, 17, 3, 5, 7, 61, 11, 13, 31, 17, 19, 3, 5, 7, 43, 11, 13, 103, 17, 19, 109, 3, 5, 7, 29, 11, 13, 53, 17, 19, 41, 23, 3, 5, 7, 31, 11, 13, 37
Offset: 2

Views

Author

Bill McEachen, Oct 26 2013

Keywords

Comments

Based on Sun's conjecture 1.4 in the paper referenced below.
The plot shows an ever-widening band of sawtooth shape. New maxima values will include sequence members larger than the largest prime factor of the original n. For example when n = 21 with prime factors 3 and 7, and a(10) = 19.
a(A000124(n)) = 3; a(A133263(n)) = 5; a(A167614(n)) = 7. - Reinhard Zumkeller, Mar 12 2014

Examples

			21 = 19+1*2 where no solution exists using p = 2, 3, 5, 7, 11, 13, 17. So a(10) = 19.
51 = 31+4*5 where no lower odd prime provides a solution. So a(25) = 31.
		

References

  • Z. W. Sun, On sums of primes and triangular numbers, Journal of Combinatorics and Number Theory 1(2009), no. 1, 65-76. (See Conjecture 1.4.)

Crossrefs

Programs

  • Haskell
    a228446 n = head
       [q | let m = 2 * n + 1,
            q <- map (m -) $ reverse $ takeWhile (< m) $ tail a002378_list,
            a010051 q == 1]
    -- Reinhard Zumkeller, Mar 12 2014
  • Mathematica
    nn = 14; ob = Table[n*(n+1), {n, nn}]; Table[p = Min[Select[n - ob, # > 0 && PrimeQ[#] &]]; p, {n, 5, ob[[-1]], 2}] (* T. D. Noe, Oct 27 2013 *)
  • PARI
    a(n) = {oddn = 2*n+1; x = oddn; while (! isprime(oddn - x*(x+1)), x--); oddn - x*(x+1);} \\ Michel Marcus, Oct 27 2013
    

Extensions

Entry revised by N. J. A. Sloane, Nov 11 2020 (including addition of escape clause).

A356754 Triangle read by rows: T(n,k) = ((n-1)*(n+2))/2 + 2*k.

Original entry on oeis.org

2, 4, 6, 7, 9, 11, 11, 13, 15, 17, 16, 18, 20, 22, 24, 22, 24, 26, 28, 30, 32, 29, 31, 33, 35, 37, 39, 41, 37, 39, 41, 43, 45, 47, 49, 51, 46, 48, 50, 52, 54, 56, 58, 60, 62, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87
Offset: 1

Views

Author

Torlach Rush, Aug 25 2022

Keywords

Comments

The first column of the triangle is the Lazy Caterer's sequence A000124.
Each subsequent column starts with A000124(n) + (2 * (n-1)).
The first downward diagonal is A046691(n).
Columns and downward diagonals of the triangle identify many sequences (possibly shifted) in the database. Examples can be found in crossrefs below.
The sum of the n-th upward diagonal of the triangle is A356288(n).

Examples

			Triangle T(n,k) begins:
  n\k   1   2   3   4   5   6   7   8   9  10  11  ...
   1:   2
   2:   4   6
   3:   7   9  11
   4:  11  13  15  17
   5:  16  18  20  22  24
   6:  22  24  26  28  30  32
   7:  29  31  33  35  37  39  41
   8:  37  39  41  43  45  47  49  51
   9:  46  48  50  52  54  56  58  60  62
  10:  56  58  60  62  64  66  68  70  72  74
  11:  67  69  71  73  75  77  79  81  83  85  87
  ...
		

Crossrefs

Programs

  • Mathematica
    Table[((n-1)(n+2))/2+2k,{n,20},{k,n}]//Flatten (* Harvey P. Dale, May 26 2023 *)
  • Python
    def T(n, k): return ((n-1) * (n+2))//2 + 2*k
    for n in range(1, 12):
        for k in range(1,(n+1)): print(T(n,k), end = ', ')
    
  • Python
    # Indexed as a linear sequence.
    def a000124(n): return n*(n+1)//2 + 1
    def a(n):
        l = m = 0
        for k in range(1,n):
            lc = a000124(k - 1)
            if n >= lc:
                l = lc
                m = k
            else: break
        return n + m + (n - l)

Formula

T(n,k) = ((n-1) * (n+2))/2 + 2*k.
T(n,k+1) = T(n,k) + 2, k < n.
Showing 1-3 of 3 results.