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.

A255312 Positive integers m for which the m-th row of A088643 in reverse agrees with the first m terms of A132075.

Original entry on oeis.org

1, 2, 3, 4, 26, 27, 35, 36, 37, 47, 153, 206, 254, 255, 267, 326, 334, 543, 544, 550, 573, 590, 604, 719, 720, 965, 1327, 1340, 1353, 1354, 1414, 1423, 1453, 1474, 1579, 1589, 1598, 1762, 1856, 2105, 2840, 2921, 2922, 2928
Offset: 1

Views

Author

Paul Boddington, Feb 20 2015

Keywords

Comments

I do not know if this sequence is infinite. Given any term it is easy to compute all earlier terms. The largest number I know of in the sequence is 21977.

Crossrefs

A088643 Triangle read by rows: row n >= 1 is obtained as follows. Start with n, next term is always largest number m with 1 <= m < n which has not yet appeared in that row and such that m + previous term in the row is a prime. Stop when no further m can be found.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Nov 24 2003

Keywords

Comments

It is conjectured that row n is always a permutation of {1..n}. This has been verified for n <= 400000.
Presumably many of the rows, when read from right to left, match the infinite sequence A055265. [But see a more precise comment that follows. - N. J. A. Sloane, Aug 14 2021]
I conjecture that almost all rows have exactly 7 (but not more) trailing terms in common with the initial terms of A055265 = (1, 2, 3, 4, 7, 6, 5, 8, ...): After row 10 whose reversal matches the first 10 terms of A055265, and rows n = 14, 15 and 16 having the last 2 (but not 3) terms equal to A055265(1..2), all rows up to n = 500 have either (about 25%) exactly 1 or (about 73%) exactly 7 trailing terms equal to the first terms of A055265. Between n = 501 and n = 10000 and beyond, all rows end in (..., 9, 14, 5, 6, 7, 4, 3, 2, 1), so they all have exactly m = 7 but not m = 8 trailing terms equal to A055265(1..m). - M. F. Hasler, Aug 03 2021
In fact, the reversed rows converge to the different sequence A132075, essentially defined by this property. - M. F. Hasler, Aug 04 2021
It seems we do not know of a proof (1) that the sequence of reversed rows of this sequence converges or (2) that A132075 is infinite; or that either statement implies the other. The reversed rows converge to A132075 if both statements are true, as suggested empirically by the early rows of this sequence. - Peter Munn, Nov 19 2021

Examples

			For example, the 20th row is 20, 17, 14, 15, 16, 13, 18, 19, 12, 11, 8, 9, 10, 7, 6, 5, 2, 3, 4, 1.
Triangle begins:
  1;
  2, 1;
  3, 2, 1;
  4, 3, 2, 1;
  5, 2, 3, 4, 1;
  6, 5, 2, 3, 4, 1;
  (...)
		

Crossrefs

A088631 and A088861 give second and third columns.

Programs

  • Haskell
    import Data.List (delete)
    a088643_tabl = map a088643_row [1..]
    a088643 n k = a088643_row n !! (k-1)
    a088643_row n = n : f n [n-1, n-2 .. 1] where
       f u vs = g vs where
         g []                            = []
         g (x:xs) | a010051 (x + u) == 1 = x : f x (delete x vs)
                  | otherwise            = g xs
    -- Reinhard Zumkeller, Jan 05 2013
    
  • Maple
    A088643 := proc(n,k)
        option remember ;
        local m,c;
        if n = 1 then
            1;
        else
            if k = 1 then
                return n;
            else
                for m from n-1 to 1 by -1 do
                    if not member(m,[seq(procname(n,c),c=1..k-1)]) then
                        if isprime(m+procname(n,k-1)) then
                            return m;
                        end if ;
                    end if;
                end do:
            end if;
        end if;
    end proc:
    for n from 1 to 10 do
    for k from 1 to n do
        printf("%d ",A088643(n,k)) ;
    end do:
    printf("\n") ;
    end do: # R. J. Mathar, Aug 18 2021
  • Mathematica
    t[n_, 1] := n; t[n_, k_] := t[n, k] = For[m = n-1, m >= 1, m--, If[ PrimeQ[m + t[n, k-1] ] && FreeQ[ Table[ t[n, j], {j, 1, k-1} ], m], Return[m] ] ]; Table[ t[n, k], {n, 1, 14}, {k, 1, n} ] // Flatten (* Jean-François Alcover, Apr 03 2013 *)
  • PARI
    apply( {A088643_row(n, t=List(-[1-n..-1]))=vector(n,i, i>1 && for(j=1,#t, isprime(n+t[j]) && [n=t[j], listpop(t,j), break]);n)}, [1..20]) \\ M. F. Hasler, Aug 02 2021; improved Aug 03 2021 after PARI below
    
  • PARI
    row(n) = { my(res = vector(n), todo = List([1..n-1])); res[1] = n; for(i = 1, n - 1, forstep(j = #todo, 1, -1, if(isprime(res[i] + todo[j]), res[i+1] = todo[j]; listpop(todo, j); next(2) ) ) ); res } \\ David A. Corneth, Aug 02 2021

Formula

A255313(n,k) = T(n,k-1) + T(n,k), n > 0 and 1 <= k <= n. - Reinhard Zumkeller, Feb 22 2015

Extensions

More terms from David Wasserman, Aug 16 2005

A132163 Triangle read by rows. For row n, start with 1 but from the second term onwards always choose the largest positive integer between 1 and n inclusive that i) has not already appeared in the row ii) gives a prime when added to the previous term. Stop if no such integer can be found.

Original entry on oeis.org

1, 1, 2, 1, 2, 3, 1, 4, 3, 2, 1, 4, 3, 2, 5, 1, 6, 5, 2, 3, 4, 1, 6, 7, 4, 3, 2, 5, 1, 6, 7, 4, 3, 8, 5, 2, 1, 6, 7, 4, 9, 8, 5, 2, 3, 1, 10, 9, 8, 5, 6, 7, 4, 3, 2, 1, 10, 9, 8, 11, 6, 7, 4, 3, 2, 5, 1, 12, 11, 8, 9, 10, 7, 6, 5, 2, 3, 4
Offset: 1

Views

Author

Paul Boddington, Nov 04 2007

Keywords

Comments

The following statements are conjectural: 1) The n-th row is always a permutation of 1,...,n. 2) For the even rows, the last term is one less than a prime (so the row gives a solution to the prime circle problem - see A051252). 3) There exists a (unique) sequence b(2), b(3),... with the property that for every n > 1 there is a positive integer N such that every even row of the triangle from the 2N-th onwards ends b(n), ..., b(3), b(2) and every odd row from the (2N - 1)-th onwards ends b(n)+(-1)^n, ..., b(3)-1, b(2)+1. (If the sequence b(n) exists it is probably A132075 without the initial term 1.)

Crossrefs

This sequence is a variation on A088643.

Programs

  • Haskell
    import Data.List (delete)
    a132163_tabl = map a132163_row [1..]
    a132163 n k = a132163_row n !! (k-1)
    a132163_row n = 1 : f 1 [n, n-1 .. 2] where
       f u vs = g vs where
         g []                            = []
         g (x:xs) | a010051 (x + u) == 1 = x : f x (delete x vs)
                  | otherwise            = g xs
    -- Reinhard Zumkeller, Jan 05 2013
  • Mathematica
    t[, 1] = 1; t[n, k_] := t[n, k] = For[ j = n, j > 1, j--, If[ PrimeQ[ t[n, k-1] + j] && FreeQ[ Table[ t[n, m], {m, 1, k-1}], j], Return[j] ] ]; Table[ t[n, k], {n, 1, 12}, {k, 1, n}] // Flatten (* Jean-François Alcover, Apr 02 2013 *)
Showing 1-3 of 3 results.