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.

A276542 Numbers k such that the k-th and (k+1)st triangular numbers have the same number of divisors.

Original entry on oeis.org

3, 4, 5, 11, 17, 28, 29, 33, 41, 42, 52, 55, 59, 66, 68, 71, 76, 85, 88, 91, 93, 101, 107, 114, 123, 137, 141, 143, 149, 150, 159, 170, 172, 179, 183, 185, 186, 188, 191, 196, 197, 201, 203, 208, 213, 215, 217, 219, 227, 232, 235, 236, 239, 243, 244, 247, 265
Offset: 1

Views

Author

K. D. Bajpai, Apr 09 2017

Keywords

Comments

The k-th triangular number T(k) = k*(k+1)/2.
The lesser member of each twin-prime pair appears in this sequence. Hence, A001359 is a subset of this sequence.

Examples

			a(3) = 5; T(5) = 5*(5+1)/2 = 15; T(5+1) = 6*(6+1)/2 = 21; 15 and 21 have 4 divisors each.
a(6) = 28; T(28) = 28*(28+1)/2 = 406; T(28+1) = 29*(29+1)/2 = 435; 406 and 435 have 8 divisors each
		

Crossrefs

Cf. A319035 (the corresponding triangular numbers).

Programs

  • GAP
    T:=List([1..270],n->n*(n+1)/2);;  a:=Filtered([1..Length(T)-1],i->Tau(T[i])=Tau(T[i+1])); # Muniru A Asiru, Dec 06 2018
    
  • Magma
    [n: n in [1..300] | DivisorSigma(0, n*(n + 1) div 2) eq DivisorSigma(0, (n + 1)*(n + 1 + 1) div 2)]; // Vincenzo Librandi, Dec 06 2018
    
  • Maple
    T:= seq(numtheory:-tau(n*(n+1)/2), n=1..1000):
    select(t -> T[t]=T[t+1], [$1..999]); # Robert Israel, Apr 09 2017
  • Mathematica
    Select[Range[1000], DivisorSigma[0, #*(# + 1)/2] == DivisorSigma[0, (# + 1)*(# + 1 + 1)/2] &]
    SequencePosition[DivisorSigma[0,#]&/@Accumulate[Range[300]],{x_,x_}][[All, 1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 02 2018 *)
  • PARI
    k=[]; for(n=1, 1000, a=numdiv(n*(n+1)/2); b=numdiv((n+1)*(n+1+1)/2); if(a==b, k=concat(k, n))); k
    
  • Python
    from sympy import divisor_count
    for n in range(1,20):
        if divisor_count(n*(n+1)/2)==divisor_count((n+1)*(n+2)/2):
            print(n, end=', ') # Stefano Spezia, Dec 06 2018