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.

A225503 Least triangular number t such that t = prime(n)*triangular(m) for some m>0, or 0 if no such t exists.

Original entry on oeis.org

6, 3, 15, 21, 66, 78, 1326, 190, 1035, 435, 465, 17205, 861, 903, 9870, 5565, 1567335, 16836, 20100, 2556, 2628, 49770, 55278, 4005, 42195, 413595, 47895, 10100265, 5995, 1437360, 32131, 8646, 1352190, 19559385, 54397665, 1642578, 12246, 52975, 501501, 134940, 336324807802305
Offset: 1

Views

Author

Alex Ratushnyak, May 09 2013

Keywords

Comments

Conjecture: a(n) > 0.
a(n) = (x^2-1)/8 where x is the least odd solution > 1 of the Pell-like equation x^2 - prime(n)*y^2 = 1 - prime(n). - Robert Israel, Jan 08 2015

Examples

			See A225502.
		

Crossrefs

Programs

  • C
    #include 
    #define TOP 300
    typedef unsigned long long U64;
    U64 isTriangular(U64 a) {
        U64 sr = 1ULL<<32, s, b, t;
        if (a < (sr/2)*(sr+1))  sr>>=1;
        while (a < sr*(sr+1)/2)  sr>>=1;
        for (b = sr>>1; b; b>>=1) {
            s = sr+b;
            if (s&1) t = s*((s+1)/2);
            else     t = (s/2)*(s+1);
            if (t >= s && a >= t)  sr = s;
        }
        return (sr*(sr+1)/2 == a);
    }
    int main() {
      U64 i, j, k, m, tm, p, pp = 1, primes[TOP];
      for (primes[0]=2, i = 3; pp < TOP; i+=2) {
        for (p = 1; p < pp; ++p) if (i%primes[p]==0) break;
        if (p==pp) {
            primes[pp++] = i;
            for (j=p=primes[pp-2], m=tm=1; ; j=k, m++, tm+=m) {
               if ((k = p*tm) < j) k=0;
               if (isTriangular(k)) break;
            }
            printf("%llu, ", k);
        }
      }
      return 0;
    }
    
  • Maple
    F:= proc(n) local p, S,x,y, z, cands, s;
          p:= ithprime(n);
          S:= {isolve(x^2 - p*y^2 = 1-p)};
          for z from 0 do
            cands:= select(s -> (subs(s,x) > 1 and subs(s,x)::odd), simplify(eval(S,_Z1=z)));
            if cands <> {} then
               x:= min(map(subs,cands, x));
               return((x^2-1)/8)
            fi
          od;
    end proc:
    map(F, [$1..100]); # Robert Israel, Jan 08 2015
  • Mathematica
    a[n_] := Module[{p, x0, sol, x, y}, p = Prime[n]; x0 = Which[n == 1, 7, n == 2, 5, True, sol = Table[Solve[x > 1 && y > 1 && x^2 - p y^2 == 1 - p, {x, y}, Integers] /. C[1] -> c, {c, 0, 1}] // Simplify; Select[x /. Flatten[sol, 1], OddQ] // Min]; (x0^2 - 1)/8];
    Array[a, 171] (* Jean-François Alcover, Apr 02 2019, after Robert Israel *)
  • PARI
    a(n) = {p = prime(n); k = 1; while (! ((t=k*(k+1)/2) && ((t % p) == 0) && ispolygonal(t/p, 3)), k++); t;} \\ Michel Marcus, Jan 08 2015

Extensions

a(171) from Giovanni Resta, Jun 19 2013

A225787 Least prime number p such that p*triangular(n) is a triangular number, or 0 if no such p exists.

Original entry on oeis.org

2, 3, 2, 11, 19, 3, 5, 0, 71, 23, 109, 131, 17, 181, 2, 239, 271, 307, 0, 379, 3, 13, 127, 61, 67, 163, 701, 47, 811, 97, 37, 991, 0, 31, 0, 79, 83, 0, 41, 7, 0, 191, 37, 0, 5, 83, 541, 251, 2351, 613, 71, 0, 0, 2861, 743, 3079, 3191, 367, 0, 3539, 229, 0, 977, 0, 4159
Offset: 0

Views

Author

Alex Ratushnyak, May 16 2013

Keywords

Examples

			Least prime p such that triangular(3)*p is a triangular number is p=11, so a(3) = 11.
		

Crossrefs

Formula

a(n) <= n^2 + n + 2. For n>0, a(n) <= n^n + n + 1.

A227054 a(n) = least triangular number t > 0 such that n*t is a triangular number, or 0 if no such t exists.

Original entry on oeis.org

1, 3, 1, 0, 3, 1, 3, 15, 0, 1, 6, 3, 6, 15, 1, 0, 78, 21, 10, 6, 1, 3, 45, 190, 0, 3, 55, 1, 15, 10, 15, 28203, 45, 105, 3, 1, 465, 120, 55, 3, 21, 15, 21, 3570, 1, 6, 210, 861, 0, 6, 3, 15, 105, 21945, 1, 21, 3, 66, 26565, 91, 276, 378, 6, 0, 1596, 1, 300
Offset: 1

Views

Author

Alex Ratushnyak, Jun 29 2013

Keywords

Comments

a(n) = 1 if and only if n is a triangular number.
Indices of conjectured 0's: 4, 9, 16, 25, 49, 64, 81, 121, 144, 169, 225, 256, 289, 361, 400, 441, 529, 576, 625, 729, ... These are squares of 2, 3, 4, 5, 7, 8, 9, 11, 12, 13, 15, 16, 17, 19, 20, 21, 23, 24, 25, 27.
a(n) = 0 if n = p^(2*j) where p is a prime and j > 0. - Jon E. Schoenfield, Sep 17 2023

Examples

			a(614) = 13964154294535688630985 = A000217(167117648945) because 614 * a(614) = A000217(4141012131555), and none of the smaller triangular numbers t satisfies 614*t = A000217(m) for some m.
		

Crossrefs

Cf. A166478 (indices of t in A000217), A225502, A225503.

Extensions

a(1)-a(25) and a(49)-a(67) from Jon E. Schoenfield, Sep 17 2023
Showing 1-3 of 3 results.