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

A267077 Least m>0 for which m*n^2 + 1 is a square and m*triangular(n) + 1 is a triangular number (A000217). Or -1 if no such m exists.

Original entry on oeis.org

1, 35, 30, 18135, 189, 27, 321300, 23760, 1188585957, 1656083, 26, 244894427400, 82093908624206325, 1858717755529547, 86478, 21491811639746039592, 26135932603458945934958445, 353382195058506640426335, 26780050, 7859354769338288038121982384, 274554988002
Offset: 0

Views

Author

Alex Ratushnyak, Jan 10 2016

Keywords

Examples

			26*10^2+1 = 2601 is a square, and 26*10*11/2+1 = 1431 = triangular(53), and 26 is the smallest such multiplier, therefore a(10) = 26.
		

Crossrefs

Programs

  • Python
    from math import sqrt
    def A267077(n):
        if n == 0:
            return 1
        u,v,t,w = max(8,2*n),max(4,n)**2-9,4*n*(n+1),n**2
        while True:
            m,r = divmod(v,t)
            if not r and int(sqrt(m*w+1))**2 == m*w+1:
                return m
            v += u+1
            u += 2 # Chai Wah Wu, Jan 15 2016
    
  • Python
    #!/usr/bin/python3
    # This sequence is easy if you use a Pell-equation solver such as labmath.py
    # Solve the A267077 Pell equation:
    # nx^2 - (4n+4)y^2 = 5n-4; but also y^2 == 1 mod n^2
    # Let u = nx, then # u^2 - n*(4n+4)y^2 = n*(5n-4)
    #   and (y > n) and (u == 0 mod n) and (y^2 == 1 mod n^2)
    # (y > n makes m > 0)
    # Report m = (y^2 - 1) / n^2
    import labmath
    print(0, 1)
    print(1, 35) # When n<2, the Pell equation is elliptical.
    for nn in range(2,1001):
        nsq = nn * nn
        ps = labmath.pell(nn*(4*nn+4), nn*(5*nn-4))
        uu,yy = next(ps[0])
        while (yy <= nn) or ((uu % nn) != 0) or ((yy*yy) % nsq != 1):
            uu,yy = next(ps[0])
        print(nn, (yy*yy - 1) // nsq)
    # From Don Reble, Apr 15 2022, added by N. J. A. Sloane, Apr 15 2022.

Extensions

a(12)-a(15) from Chai Wah Wu, Jan 16 2016
a(16) and beyond from Don Reble, Apr 15 2022

A344006 a(n) = m*(m+1)/n, where A344005(n) is the smallest number m such that n divides m*(m+1).

Original entry on oeis.org

2, 1, 2, 3, 4, 1, 6, 7, 8, 2, 10, 1, 12, 3, 2, 15, 16, 4, 18, 1, 2, 5, 22, 3, 24, 6, 26, 2, 28, 1, 30, 31, 4, 8, 6, 2, 36, 9, 4, 6, 40, 1, 42, 3, 2, 11, 46, 5, 48, 12, 6, 3, 52, 13, 2, 1, 6, 14, 58, 4, 60, 15, 12, 63, 10, 2, 66, 4, 8, 3, 70, 1, 72, 18, 8, 5, 6, 2, 78, 3, 80, 20, 82, 5
Offset: 1

Views

Author

N. J. A. Sloane, Jun 04 2021

Keywords

Comments

a(n) = n-1 if n is a prime power. - Chai Wah Wu, Jun 04 2021

Crossrefs

Programs

  • PARI
    a(n) = for(m=1, oo, if((m*(m+1))%n==0, return(m*(m+1)/n))) \\ Felix Fröhlich, Jun 04 2021
    (Python 3.8+)
    from itertools import combinations
    from math import prod
    from sympy import factorint
    from sympy.ntheory.modular import crt
    def A344006(n):
        if n == 1:
            return 2
        plist = [p**q for p, q in factorint(n).items()]
        if len(plist) == 1:
            return n-1
        else:
            m = int(min(min(crt([m,n//m],[0,-1])[0],crt([n//m,m],[0,-1])[0]) for m in (prod(d) for l in range(1,len(plist)//2+1) for d in combinations(plist,l))))
            return m*(m+1)//n # Chai Wah Wu, Jun 04 2021

A382244 Lexicographically earliest sequence of distinct nonnegative integers such that for any n >= 0, n*a(n) is a triangular number (A000217).

Original entry on oeis.org

0, 1, 3, 2, 7, 9, 6, 4, 15, 5, 12, 21, 10, 25, 27, 8, 31, 33, 35, 37, 39, 11, 24, 45, 22, 13, 30, 14, 42, 57, 26, 16, 63, 17, 67, 18, 56, 19, 75, 20, 52, 81, 28, 85, 87, 23, 51, 93, 95, 97, 99, 46, 40, 105, 60, 90, 36, 29, 66, 117, 54, 121, 69, 32, 127, 84, 58
Offset: 0

Views

Author

Rémy Sigrist, Mar 19 2025

Keywords

Comments

A self-inverse permutation of the nonnegative integers.

Examples

			The initial terms are:
  n   a(n)  n*a(n)
  --  ----  -----------------
   0     0    0 = A000217(0)
   1     1    1 = A000217(1)
   2     3    6 = A000217(3)
   3     2    6 = A000217(3)
   4     7   28 = A000217(7)
   5     9   45 = A000217(9)
   6     6   36 = A000217(8)
   7     4   28 = A000217(7)
   8    15  120 = A000217(15)
   9     5   45 = A000217(9)
  10    12  120 = A000217(15)
  11    21  231 = A000217(21)
  12    10  120 = A000217(15)
  13    25  325 = A000217(25)
  14    27  378 = A000217(27)
  15     8  120 = A000217(15)
		

Crossrefs

Programs

  • PARI
    \\ See Links section.

Formula

a(n) >= A061782(n) for any n > 0.

A193470 Square array A(n,k) (n>=1, k>=0) read by antidiagonals: A(n,0) = 0 and A(n,k) is the least integer > A(n,k-1) that can be expressed as a triangular number divided by n.

Original entry on oeis.org

0, 0, 1, 0, 3, 3, 0, 1, 5, 6, 0, 7, 2, 14, 10, 0, 2, 9, 5, 18, 15, 0, 1, 3, 30, 7, 33, 21, 0, 3, 6, 9, 34, 12, 39, 28, 0, 15, 4, 11, 11, 69, 15, 60, 36, 0, 4, 17, 13, 13, 21, 75, 22, 68, 45, 0, 1, 5, 62, 15, 20, 24, 124, 26, 95, 55, 0, 5, 12, 17, 66, 30, 35, 38, 132, 35, 105, 66
Offset: 1

Views

Author

Peter Luschny, Jul 27 2011

Keywords

Examples

			n\k  0   1   2    3    4     5     6     7
------------------------------------------
1 |  0   1   3    6   10    15    21    28    A000217
2 |  0   3   5   14   18    33    39    60    A074378
3 |  0   1   2    5    7    12    15    22    A001318
4 |  0   7   9   30   34    69    75   124    A154260
5 |  0   2   3    9   11    21    24    38    A057569
6 |  0   1   6   11   13    20    35    46    A154293
7 |  0   3   4   13   15    30    33    54    A057570
8 |  0  15  17   62   66   141   147   252    A157716
		

Crossrefs

Programs

  • Maple
    A193470_rect := proc(n,k) local j,i,L; L := NULL; j := 0; while nops([L]) < k do add(i/n, i=1..j); if type(%,integer) then L := L,% fi; j := j+1 od; L end:
    seq(print(A193470_rect(n, 12)),n = 1..8);
  • Mathematica
    a[, 0] = 0; a[n, k_] := a[n, k] = For[j = a[n, k-1]+1, True, j++, If[Reduce[m > 0 && j == m(m+1)/(2n), m, Integers] =!= False, Return[j]]]; Table[a[n-k, k], {n, 1, 12}, {k, 0, n-1}] // Flatten (* Jean-François Alcover, Nov 07 2016 *)

A344949 a(n) is the smallest square s > 0 such that s*(2n+1) is a triangular number.

Original entry on oeis.org

1, 1, 9, 4, 4, 441, 25, 1, 9, 9, 1, 3218436, 49, 1089, 1656369, 16, 16, 225, 46225, 9, 81, 314721, 1, 12217323024, 25, 25, 2427192623025, 1, 2304, 199572129, 121, 400, 81225, 39727809, 4, 36, 36, 4, 736164, 94864, 592900, 4357032433168041, 169, 3025, 3600, 1
Offset: 0

Views

Author

Mihai Prunescu, Jun 03 2021

Keywords

Comments

Proof that every odd natural number 2n+1 is a triangular number divided by a square. As the number 4n + 2 is never a square, Pell's equation x^2 - (4n+2)*y^2 = 1 has solutions in integers with y != 0 for every n. It is immediate that x has to be odd. We replace x = 2b+1 and we observe that y must be then even. We replace y = 2a and it follows that b(b+1)/2 = (2n+1)*a^2. So (2n+1) is a triangular number divided by a square. Of course, for given n, there are infinitely many such pairs (b,a).

Crossrefs

Programs

  • Mathematica
    Table[k=1;While[!IntegerQ[Sqrt[8k^2(2n+1)+1]],k++];k^2,{n,0,22}] (* Giorgos Kalogeropoulos, Jun 03 2021 *)
  • PARI
    a(n) = my(k=1); while (!ispolygonal(k^2*(2*n+1), 3), k++); k^2; \\ Michel Marcus, Jun 06 2021
    
  • Python
    from sympy.solvers.diophantine.diophantine import diop_DN
    def A344949(n): return min(d[1]**2 for d in diop_DN(4*n+2, 1))//4 # Chai Wah Wu, Jun 21 2021
Showing 1-5 of 5 results.