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-2 of 2 results.

A081974 a(1) = 1 and smallest number not occurring earlier such that the product of two neighboring terms is a distinct triangular number, where "distinct" means that a(n)*a(n+1) may not equal the product of any two previous consecutive terms.

Original entry on oeis.org

1, 3, 2, 5, 9, 4, 7, 13, 6, 11, 21, 10, 12, 23, 45, 14, 27, 53, 26, 30, 33, 16, 31, 15, 20, 41, 81, 40, 52, 103, 51, 25, 49, 24, 47, 93, 46, 91, 60, 76, 151, 75, 37, 18, 112, 115, 57, 28, 55, 39, 19, 87, 43, 22, 133, 66, 58, 117, 35, 17, 8, 395, 126, 141, 70, 102, 90, 116, 231
Offset: 1

Views

Author

Amarnath Murthy, Apr 03 2003

Keywords

Comments

Perhaps another re-arrangement of natural numbers.

Examples

			5 and 4 are the neighbors of 9 giving the triangular numbers 45 and 36 respectively.
		

Crossrefs

Programs

  • Maple
    Acands:= [$2..10^4]: ncands:= 10^4-1: Tused:= {}:
    a[1]:= 1:
    for i from 2 to 100 do
      found:= false;
      for j from 1 to ncands do
        if istri(a[i-1]*Acands[j]) and not member(a[i-1]*Acands[j],Tused) then
           found:= true; a[i]:= Acands[j];
           Acands:= subsop(j=NULL, Acands);
           ncands:= ncands - 1;
           Tused:= Tused union {a[i-1]*a[i]};
           break
        fi
       od;
       if not found then break fi
    od:
    seq(a[k],k=1..100); # Robert Israel, Jul 23 2025
  • Mathematica
    istriang[n_] := With[{x = Floor[Sqrt[2*n]]}, n == x*(x + 1)/2];
    nmax = 75;
    Clear[a, used, tris];
    a[] = 0; used[] = 0; tris[_] = 0; a[1] = 1; used[1] = 1;
    For[i = 2, i <= nmax, i++, f = a[i-1]; j = 2; While[used[j] == 1 || !istriang[f*j] || tris[f*j] == 1, j++]; a[i] = j; used[j] = 1; tris[f*j] = 1];
    Table[a[n], {n, 1, nmax}] (* Jean-François Alcover, May 23 2024, after PARI code *)
  • PARI
    istriang(n) = local(x); x = floor(sqrt(2*n)); n == x*(x + 1)/2;
    A = vector(75); used = vector(1000); tris = vector(50000); A[1] = 1; used[1] = 1; for (i = 2, 75, f = A[i - 1]; j = 2; while (used[j] || !istriang(f*j) || tris[f*j], j = j + 1); A[i] = j; used[j] = 1; tris[f*j] = 1); print(A)

Extensions

More terms from David Wasserman, Jul 26 2004

A081975 Triangular number pertaining to A081974. a(n) = A081974(n)*A081974(n+1).

Original entry on oeis.org

3, 6, 10, 45, 36, 28, 91, 78, 66, 231, 210, 120, 276, 1035, 630, 378, 1431, 1378, 780, 990, 528, 496, 465, 300, 820, 3321, 3240, 2080, 5356, 5253, 1275, 1225, 1176, 1128, 4371, 4278, 4186, 5460, 4560, 11476, 11325, 2775, 666, 2016, 12880, 6555, 1596
Offset: 1

Views

Author

Amarnath Murthy, Apr 03 2003

Keywords

Comments

A subset of A000217. - R. J. Mathar, Apr 05 2007

Crossrefs

Programs

  • Maple
    isA000217 := proc(n) local t; t := (sqrt(1+8*n)-1)/2 ; type(t,'integer'); end: A081974 := proc(nmax) local a,n,prodset; a := [1,3] ; prodset := {3} ; while nops(a) < nmax do n := 2 ; while n in a or n*op(-1,a) in prodset or isA000217(n*op(-1,a)) = false do n := n+1 ; od ; prodset := prodset union { n*op(-1,a) } ; a := [op(a),n] ; od ; RETURN(a) ; end: A081975 := proc(nmax) local a ; a081974 := A081974(nmax) ; a := [] ; for i from 2 to nops(a081974) do a := [op(a), op(i,a081974)*op(i-1,a081974)] ; od ; RETURN(a) ; end: a := A081975(100) ; # R. J. Mathar, Apr 05 2007
  • Mathematica
    istriang[n_] := With[{x = Floor[Sqrt[2*n]]}, n == x*(x + 1)/2];
    nmax = 47;
    Clear[b, used, tris];
    b[] = 0; used[] = 0; tris[_] = 0; b[1] = 1; used[1] = 1;
    For[i = 2, i <= nmax+1, i++, f = b[i-1]; j = 2; While[used[j] == 1 || !istriang[f*j] || tris[f*j] == 1, j++]; b[i] = j; used[j] = 1; tris[f*j] = 1];
    a[n_] := b[n]*b[n + 1];
    Table[a[n], {n, 1, nmax}] (* Jean-François Alcover, May 23 2024, after PARI code in A081974 *)

Extensions

More terms from R. J. Mathar, Apr 05 2007
Showing 1-2 of 2 results.