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

A027861 Numbers k such that k^2 + (k+1)^2 is prime.

Original entry on oeis.org

1, 2, 4, 5, 7, 9, 12, 14, 17, 19, 22, 24, 25, 29, 30, 32, 34, 35, 39, 42, 47, 50, 60, 65, 69, 70, 72, 79, 82, 84, 85, 87, 90, 97, 99, 100, 102, 104, 109, 110, 115, 122, 130, 135, 137, 139, 144, 149, 154, 157, 160, 162, 164, 167, 172, 174, 185, 187, 189, 195, 199, 202
Offset: 1

Views

Author

Keywords

Comments

k > 1 never ends in 1, 3, 6 or 8 (that is, k*(k+1) does not end in 2). - Lekraj Beedassy, Jul 09 2004
k > 1 can never be congruent to (1 or 3) mod 5, because if it were, then k^2 + (k+1)^2 would be divisible by 5. In other words, for k > 1, this sequence cannot contain any values in A047219. This means that we can immediately discard 40% of all possible k. - Dmitry Kamenetsky, Sep 02 2008

Crossrefs

Complement of A012132.
Cf. A002731 (2k+1 values), A027862 (resulting primes), A091277 (indices of resulting primes).
Cf. A047219 (k mod 5 = 1 or 3), A001844 (centered squares), A010051.

Programs

  • Haskell
    a027861 n = a027861_list !! (n-1)
    a027861_list = filter ((== 1) . a010051 . a001844) [0..]
    -- Reinhard Zumkeller, Jul 13 2014
    
  • Magma
    [n: n in [0..1000] |IsPrime(n^2 + (n+1)^2)]; // Vincenzo Librandi, Nov 19 2010
    
  • Mathematica
    Select[Range[250],PrimeQ[#^2+(#+1)^2]&] (* Harvey P. Dale, Dec 31 2017 *)
  • PARI
    is(n)=isprime(n^2 + (n+1)^2) \\ Charles R Greathouse IV, Apr 28 2015

Formula

a(n) = (A002731(n)-1)/2.
a(n) = (sqrt(2*A027862(n)-1)-1)/2. - Zak Seidov, Jul 22 2013
A010051(A001844(a(n))) = 1. - Reinhard Zumkeller, Jul 13 2014
a(n) = floor(sqrt(A027862(n)/2)). - Rémi Guillaume, Apr 02 2025

A089982 Triangular numbers that can be expressed as the sum of 2 positive triangular numbers.

Original entry on oeis.org

6, 21, 36, 55, 66, 91, 120, 136, 171, 210, 231, 276, 351, 378, 406, 496, 561, 666, 703, 741, 820, 861, 946, 990, 1035, 1081, 1176, 1225, 1326, 1378, 1431, 1485, 1540, 1596, 1653, 1711, 1770, 1891, 1953, 2016, 2080, 2211, 2278, 2346, 2556, 2701, 2775, 2850
Offset: 1

Views

Author

Jon Perry, Jan 13 2004

Keywords

Comments

Intersection of triangular numbers with sumset of triangular numbers. Triangular number analog of what for squares is {A057100(n)^2} = {A009000(n)^2}. {A000217} INTERSECT {A000217 + A000217}. - Jonathan Vos Post, Mar 09 2007
A subsequence of A051533. - Wolfdieter Lang, Jan 11 2017

Examples

			Generally, A000217(A000217(n)) = A000217(A000217(n)-1) + A000217(n) and so is automatically included. These are 6=T(3), 21=T(6), 55=T(10), etc. Other solutions occur when a partial sum from x to y is triangular, e.g., 15 + 16 + 17 + 18 = 66 = T(11), so T(14) + T(11) = T(18). This particular example arises since 10+4k is triangular (at k=14, 10 + 4k = 66), and we therefore have a solution.
All other solutions occur when 3+2k, 6+3k, 10+4k, etc. -- in general, T(j) + j*k -- is triangular.
		

Crossrefs

Programs

  • Mathematica
    trn[i_]:=Module[{trnos=Accumulate[Range[i]],t2s},t2s=Union[Total/@ Tuples[ trnos,2]];Intersection[trnos,t2s]] (* Harvey P. Dale, Nov 08 2011 *)
    Select[Range[75], ! PrimeQ[#^2 + (# + 1)^2] &] /. Integer_ -> (Integer^2 + Integer)/2 (* Arkadiusz Wesolowski, Dec 03 2015 *)
  • PARI
    t(i) = i*(i+1)/2;
    { v=vector(100,i,t(i)); y=vector(100); c=0; for (i=1,30, for (j=i,30, x=t(i)+t(j); f=0; for (k=1,100,if (x==v[k],f=1;break)); if (f==1,y[c++ ]=x))); select(x->(x>0), vecsort(y,,8)) } \\ slightly edited by Michel Marcus, Apr 15 2021
    
  • PARI
    lista(nn) = {for (n=1, nn, my(t = n*(n+1)/2); for (k=1, n-1, if (ispolygonal(t - k*(k+1)/2, 3), print1(t, ", "); break;)););} \\ Michel Marcus, Apr 15 2021
    
  • Python
    from itertools import count, takewhile
    def aupto(lim):
        t = list(takewhile(lambda x: x<=lim, (i*(i+1)//2 for i in count(1))))
        s = set(a+b for i, a in enumerate(t) for b in t[i:])
        return sorted(s & set(t))
    print(aupto(3000)) # Michael S. Branicky, Jun 21 2021

Formula

Triangular number m is in this sequence iff A000161(4*m+1)>1 or, alternatively, A083025(4*m+1)>1. - Max Alekseyev, Oct 24 2008
a(n) = A000217(A012132(n)). - Ivan N. Ianakiev, Jan 17 2013

Extensions

More terms from Lambert Klasen (Lambert.Klasen(AT)gmx.net) and David Wasserman, Sep 23 2005

A166080 Nonprimes of the form (k^2+1)/2.

Original entry on oeis.org

1, 25, 85, 145, 221, 265, 365, 481, 545, 685, 841, 925, 1105, 1405, 1513, 1625, 1985, 2245, 2665, 2813, 2965, 3281, 3445, 3785, 3961, 4141, 4325, 4705, 4901, 5305, 5513, 5725, 5941, 6161, 6385, 6613, 6845, 7081, 7565, 7813, 8065, 8321, 8845, 9113, 9385
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Oct 06 2009

Keywords

Comments

Or, 1 together with composite numbers of the form i^2+(i+1)^2. See A012132. - N. J. A. Sloane, Feb 29 2020

Examples

			a(1)=(1^2+1)/2=1; a(2)=(7^2+1)/2=25.
		

Crossrefs

Programs

  • Mathematica
    Select[(Range[0,150]^2+1)/2,IntegerQ[#]&&!PrimeQ[#]&] (* Harvey P. Dale, Aug 09 2025 *)

Formula

a(n) = 2n^2 + O(n^2/log n). - Charles R Greathouse IV, Mar 21 2014

Extensions

Replaced 6261 by 6161 - R. J. Mathar, Oct 07 2009

A309332 Number of ways the n-th triangular number T(n) = A000217(n) can be written as the sum of two positive triangular numbers.

Original entry on oeis.org

0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 2, 0, 3, 0, 0, 1, 1, 3, 0, 0, 1, 0, 1, 0, 0, 3, 1, 1, 0, 1, 3, 0, 1, 1, 1, 2, 0, 1, 2, 0, 1, 1, 2, 1, 1, 1, 1, 2, 1, 0, 3, 1, 1, 1, 0, 3, 1, 1, 0, 0, 2, 0, 1, 1, 1, 1, 1, 5, 0, 1, 1, 0, 1, 0, 0, 3, 0, 3, 1, 0, 3, 1, 3, 1, 3, 3, 0, 1, 0, 0, 3, 0, 2, 0, 1
Offset: 1

Views

Author

Alois P. Heinz, Aug 01 2019

Keywords

Comments

The order doesn't matter. 21 = 6+15 = 15+6 are not counted as distinct solutions. - N. J. A. Sloane, Feb 22 2020

Examples

			a(3) = 1: 2*3/2 + 2*3/2 = 3*4/2.
a(21) = 2: 6*7/2 + 20*21/2 = 12*13/2 + 17*18/2 = 21*22/2.
a(23) = 3: 9*10/2 + 21*22/2 = 11*12/2 + 20*21/2 = 14*15/2 + 18*19/2 = 23*24/2.
		

Crossrefs

Cf. A000217, A001652, A012132, A027861, A046080 (the same for squares), A053141, A062301 (the same for primes), A108769, A309507.

Programs

  • Maple
    a:= proc(n) local h, j, r, w; h, r:= n*(n+1), 0;
          for j from n-1 by -1 do w:= j*(j+1);
            if 2*w
    				
  • Mathematica
    a[n_] := Module[{h = n(n+1), j, r = 0, w}, For[j = n-1, True, j--, w = j(j+1); If[2w < h, Break[]]; If[ IntegerQ[Sqrt[4(h-w)+1]], r++]]; r];
    Table[a[n], {n, 1, 120}] (* Jean-François Alcover, Nov 16 2022, after Alois P. Heinz *)

Formula

a(n) > 0 <=> n in { A012132 }.
a(n) = 0 <=> n in { A027861 }.
a(n) = 1 <=> n in { A108769 }.

A308395 Numbers y such that x*(x+1) + y*(y+1) = z*(z+1) is solvable in positive integers x, z with x <= y.

Original entry on oeis.org

2, 5, 6, 9, 10, 13, 14, 17, 18, 20, 21, 22, 24, 25, 26, 27, 29, 30, 33, 34, 35, 37, 38, 39, 41, 42, 44, 45, 46, 48, 49, 50, 51, 53, 54, 55, 56, 57, 58, 61, 62, 65, 66, 68, 69, 70, 73, 74, 75, 76, 77, 78, 80, 81, 82, 84, 85, 86, 89, 90, 91, 92, 93, 94, 95, 97
Offset: 1

Views

Author

Ralf Steiner, Jul 31 2019

Keywords

Examples

			14 is a term because 14*15 + 14*15 = 20*21.
		

Crossrefs

Cf. A012132.

Programs

  • Mathematica
    max = 220; lst = {}; For[x = 1, x < max, x++,
    For[y = x, y < max, y++,
      For[z = y, z < max, z++,
       If[x (x + 1) + y (y + 1) == z (z + 1),
        lst = AppendTo[lst, y]]]]]; Select[Union[lst], # < max/2 &]
  • Python
    from sympy import integer_nthroot
    A308395_list, y, w = [], 1, 0
    while len(A308395_list) < 10000:
        w += y
        z = 0
        for x in range(1,y+1):
            z += x
            if integer_nthroot(8*(w+z)+1,2)[1]:
                A308395_list.append(y)
                break
        y += 1 # Chai Wah Wu, Aug 02 2019

A134002 Positive integers n such that n(n+5)=a(a+5)+b(b+5) is solvable in positive integers.

Original entry on oeis.org

5, 10, 11, 13, 15, 16, 20, 23, 24, 25, 30, 31, 33, 35, 36, 37, 38, 40, 42, 45, 46, 47, 49, 50, 55, 57, 60, 61, 62, 63, 64, 65, 67, 68, 69, 70, 71, 73, 75, 76, 80, 81, 84, 85, 86, 88, 89, 90, 92, 95, 98, 99, 100, 101, 102, 105, 108, 110, 111, 112, 114, 115, 118, 120, 124, 125
Offset: 1

Views

Author

John W. Layman, Oct 01 2007

Keywords

Comments

Conjecture. If n a positive integer not a term of this sequence, then n^2+(n+5)^2 is prime. (This has been verified up to n=500.) Examples. For n=1,2,3,4,6,7, n^2+(n+5)^2 is 37, 53,73, 97, 157 and 193, each of which is prime. See A134003 for the complement of this sequence.

Examples

			5(5+5)=50=14+36=2(2+5)+4(4+5), so 5 is a term of the sequence.
		

Crossrefs

A134003 Positive integers n for which n^2+(n+5)^2 is prime.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 8, 9, 12, 14, 17, 18, 19, 21, 22, 26, 27, 28, 29, 32, 34, 39, 41, 43, 44, 48, 51, 52, 53, 54, 56, 58, 59, 66, 72, 74, 77, 78, 79, 82, 83, 87, 91, 93, 94, 96, 97, 103, 104, 106, 107, 109, 113, 116, 117, 119, 121, 122, 123, 126, 134, 136, 137, 144, 151, 157
Offset: 1

Views

Author

John W. Layman, Oct 01 2007

Keywords

Comments

Conjecture. If n is in this sequence then n(n+5)=a(a+5)+b(b+5) is not solvable in integers. (This has been verified up to n=500.) See A134002 for the complement of this sequence (in the positive integers).

Crossrefs

Programs

A309388 Numbers y such that x*(x+1) + y*(y+1) = z*(z+1) does not have a solution in positive integers x, z with x <= y.

Original entry on oeis.org

1, 3, 4, 7, 8, 11, 12, 15, 16, 19, 23, 28, 31, 32, 36, 40, 43, 47, 52, 59, 60, 63, 64, 67, 71, 72, 79, 83, 87, 88, 96, 100, 103, 107, 108, 112, 127, 128, 131, 136, 139, 148, 151, 156, 163, 167, 172, 176, 179, 180, 183, 187, 191, 192, 196, 199, 211, 223, 227
Offset: 1

Views

Author

Ralf Steiner, Aug 02 2019

Keywords

Comments

The similar sequence A027861 (complement of A012132) is related to primes.

Crossrefs

Complement of A308395.

Programs

  • Maple
    filter:= proc(y) local S;
      S:= map(t -> subs(t, x), [isolve(x*(x+1)+y*(y+1)=z*(z+1))]);
      select(t -> t>0 and t<=y, S) = []
    end proc:
    select(filter, [$1..300]); # Robert Israel, Aug 06 2019
  • Mathematica
    max = 500; lst = {}; For[x = 1, x < max, x++,
    For[y = x, y < max, y++,
      For[z = y, z < max, z++,
       If[x (x + 1) + y (y + 1) == z (z + 1),
        lst = AppendTo[lst, y]]]]]; lst =
    Select[Union[lst], # < max/2 &]; Complement[Range[Length[lst]], lst]
  • Python
    from sympy import integer_nthroot
    A309388_list, y, w = [], 1, 0
    while len(A309388_list) < 10000:
        w += y
        z = 0
        for x in range(1,y+1):
            z += x
            if integer_nthroot(8*(w+z)+1,2)[1]:
                break
        else:
            A309388_list.append(y)
        y += 1 # Chai Wah Wu, Aug 07 2019

A108760 Irregular array: n-th row consists of nonnegative integers i less than n such that n divides i(i+1).

Original entry on oeis.org

0, 1, 0, 2, 0, 3, 0, 4, 0, 2, 3, 5, 0, 6, 0, 7, 0, 8, 0, 4, 5, 9, 0, 10, 0, 3, 8, 11, 0, 12, 0, 6, 7, 13, 0, 5, 9, 14, 0, 15, 0, 16, 0, 8, 9, 17, 0, 18, 0, 4, 15, 19, 0, 6, 14, 20, 0, 10, 11, 21, 0, 22, 0, 8, 15, 23, 0, 24, 0, 12, 13, 25, 0, 26, 0, 7, 20, 27, 0, 28, 0, 5, 9, 14, 15, 20, 24, 29
Offset: 2

Views

Author

Robert Phillips (bobp(AT)usca.edu), Jun 24 2005

Keywords

Comments

Row n starts with 0 and ends with n-1.
Row n of this irregular array can be viewed as the first row of an infinite matrix with elements a_{j,i} = T(n,i)+n*j. That matrix consists of all nonnegative integers i such that n divides i(i+1).
I use these matrices to generate subsequences of A012132, as you may see on page 9 of my referenced work.

Examples

			Row 12 is 0,3,8,11 which is the first row of the matrix:
   0  3  8 11
  12 15 20 23
  24 27 32 35
  ...
giving all nonnegative integers i such that 12 divides i(i+1) (cf. A108752).
Array begins:
  0, 1;
  0, 2;
  0, 3;
  0, 4;
  0, 2, 3, 5;
  0, 6;
  0, 7;
  0, 8;
  0, 4, 5, 9;
  ...
		

Crossrefs

Programs

  • Python
    [i for n in range(2, 30) for i in range(0, n) if i*(i+1)%n==0] # Andrey Zabolotskiy, Mar 19 2022

Extensions

Edited by Andrey Zabolotskiy, Mar 19 2022
Showing 1-9 of 9 results.