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

A124934 Numbers of the form 4mn - m - n, where m, n are positive integers.

Original entry on oeis.org

2, 5, 8, 11, 12, 14, 17, 19, 20, 23, 26, 29, 30, 32, 33, 35, 38, 40, 41, 44, 47, 50, 52, 53, 54, 56, 59, 61, 62, 63, 65, 68, 71, 74, 75, 77, 80, 82, 83, 85, 86, 89, 90, 92, 95, 96, 98, 101, 103, 104, 107, 109, 110, 113, 116, 117, 118, 119, 122, 124, 125, 128, 129, 131
Offset: 1

Views

Author

Nick Hobson, Nov 13 2006

Keywords

Comments

a(n) misses the squares since (2x)^2 + 1 = (4m - 1)(4n - 1) is impossible.
a(n) misses the triangular numbers since (2x + 1)^2 + 1 = 2(4m - 1)(4n - 1) is impossible.
Taking m = k(k - 1)/2, n = k(k + 1)/2 gives 4mn - m - n = (k^2 - 1)^2 - 1, so a(n) is one less than a square infinitely often.
Complement of A094178; A125203(a(n)) > 0; union of A125217 and A125218; range of A125199. - Reinhard Zumkeller, Nov 24 2006

Examples

			a(1) = 2 because 2 = 4*1*1 - 1 - 1 is the smallest value in the sequence.
		

References

  • L. E. Dickson, History of the Theory of Numbers, Vol. II, Diophantine Analysis. Dover Publications, Inc., Mineola, NY, 2005, p. 401.

Crossrefs

Programs

  • Haskell
    import Data.List (findIndices)
    a124934 n = a124934_list !! (n-1)
    a124934_list = map (+ 1) $ findIndices (> 0) a125203_list
    -- Reinhard Zumkeller, Jan 02 2013

Extensions

More terms from Reinhard Zumkeller, Nov 24 2006

A125203 Number of ways to write n as 4*x*y - x - y with 1<=x<=y.

Original entry on oeis.org

0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 2, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 2, 0, 0, 1, 0, 0, 2, 0, 0, 1, 0, 1, 1, 1, 0, 2, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 2, 0, 0, 2, 0, 0, 2, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 2, 0, 0, 2, 1, 0, 1, 0, 0, 1, 2, 0, 1, 0, 0, 2, 0, 1, 1, 0
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 24 2006

Keywords

Comments

a(A094178(n))=0; a(A124934(n))>0; a(A125217(n))=1; a(A125218(n))>1.

Crossrefs

Programs

  • Haskell
    a125203 n = length [() | x <- [1 .. (n + 1) `div` 3],
                             let (y,m) = divMod (x + n) (4 * x - 1),
                             x <= y, m == 0]
    -- Reinhard Zumkeller, Jan 02 2013
  • Mathematica
    a[n_] := Solve[1<=x<=y && n == 4 x y - x - y, {x, y}, Integers] // Length;
    Table[a[n], {n, 1, 105}] (* Jean-François Alcover, Oct 12 2021 *)

A376208 Numbers k such that 4*k+1 is the hypotenuse of a primitive Pythagorean triangle with an even short leg.

Original entry on oeis.org

4, 7, 9, 13, 16, 18, 21, 25, 27, 31, 34, 36, 43, 46, 49, 51, 55, 57, 60, 64, 66, 70, 73, 76, 81, 87, 91, 93, 94, 99, 100, 102, 111, 112, 114, 121, 123, 126, 127, 133, 136, 141, 144, 148, 150, 156, 157, 160, 165, 169, 171, 172, 175, 181, 183, 186, 189, 196, 198, 202
Offset: 1

Views

Author

Hugo Pfoertner, Sep 20 2024

Keywords

Comments

This sequence is not A094178 \ A375750, because there are hypotenuses for which both kinds of triangles exist. The smallest example occurs for hypotenuse c = 4*a(5) + 1 = 65. The triangle (16, 63, 65) has an even short leg, but there is also the triangle (33, 56, 65) with an odd short leg. Thus, 16 = (65-1)/4 is a term in this sequence and in A375750.
Sorted distinct values of ({A081985} - 1)/4.

Crossrefs

Programs

  • PARI
    is_a376208(n,r=0) = my(c=4*n+1, q=qfbsolve(Qfb(1,0,1), c^2, 3), qd=#q, is=0); for(k=1, qd-1, if(vecmin(abs(q[k]))%2==r && gcd([c,q[k]])==1, is=1; break)); is
    
  • Python
    # for an array from the beginning
    from math import gcd, isqrt
    test_all_k_upto = 202
    A376208, limit = set(), test_all_k_upto * 4 + 1
    for x in range(2,isqrt(limit)+1):
        for y in range(min(((d:=isqrt(2*x**2)-x))-(d%2==x%2), (yy:=isqrt(limit-x**2))-(yy%2==x%2)),0,-2):
            if gcd(x, y) == 1: A376208.add((x**2 + y**2 - 1) // 4)
    print(A376208:=sorted(A376208)) # Karl-Heinz Hofmann, Sep 28 2024
    
  • Python
    # for testing high single terms
    from math import isqrt, gcd
    from sympy import factorint
    def A376208_isok(k):
        c  = k * 4 + 1
        if any([(pf-1) % 4 for pf in factorint(c)]): return False # (Test imported from A008846)
        y2 = c - (x2:=(x:=isqrt(c))**2)
        while 2*x*(y:=isqrt(y2)) < x2-y2:
            if y2 == y**2 and gcd(x, y) == 1: return True
            x -= 1
            y2 = c - (x2:=x**2) # Karl-Heinz Hofmann, Oct 17 2024

A031358 Number of coincidence site lattices of index 4n+1 in lattice Z^2.

Original entry on oeis.org

1, 2, 0, 2, 2, 0, 2, 2, 0, 2, 2, 0, 0, 2, 0, 2, 4, 0, 2, 0, 0, 4, 2, 0, 2, 2, 0, 2, 2, 0, 0, 2, 0, 0, 2, 0, 4, 2, 0, 2, 0, 0, 2, 2, 0, 2, 4, 0, 2, 2, 0, 4, 0, 0, 0, 4, 0, 2, 2, 0, 2, 0, 0, 0, 2, 0, 4, 2, 0, 2, 2, 0, 2, 2, 0, 0, 4, 0, 2, 2, 0, 4, 0, 0, 2, 0, 0, 2, 2, 0, 0, 4, 0, 2, 4, 0, 0, 2, 0, 2, 2, 0, 2, 0, 0, 2
Offset: 0

Views

Author

Keywords

Crossrefs

Cf. A175647, A031359, A331140, A106594, A094178 (positions of nonzero terms).

Programs

  • PARI
    t1=direuler(p=2,1200,(1+(p%4<2)*X))
    t2=direuler(p=2,1200,1/(1-(p%4<2)*X))
    t3=dirmul(t1,t2)
    t4=vector(200,n,t3[4*n+1]) \\ and then prepend 1

Formula

Dirichlet series: Product_{primes p == 1 mod 4} (1+p^(-s))/(1-p^(-s)).
a(n) = 2*A106594(n) for n > 0. - Andrey Zabolotskiy, Jan 30 2020

Extensions

More terms from N. J. A. Sloane, Mar 13 2009
Added condition that p must be prime to the Dirichlet series. - N. J. A. Sloane, May 26 2014
Offset corrected by Andrey Zabolotskiy, Jan 30 2020

A376210 Numbers k for which among all possible Pythagorean triangles with the hypotenuse 4*k+1, the minimum of the lengths of the shorter legs is even.

Original entry on oeis.org

4, 7, 9, 13, 16, 18, 25, 27, 34, 43, 49, 57, 60, 64, 70, 73, 81, 87, 93, 99, 100, 102, 111, 112, 114, 121, 123, 127, 133, 144, 148, 150, 157, 160, 165, 169, 175, 183, 186, 189, 196, 202, 207, 211, 214, 219, 225, 235, 241, 244, 249, 255, 256, 258, 262, 265, 273
Offset: 1

Views

Author

Hugo Pfoertner, Sep 21 2024

Keywords

Examples

			       Hypotenuses                A376210
       4k+1                       |  A376211
   k   A008846                    |  |  A376208
   |   |  Sorted legs [x,y] of    |  |  |  A375750
   |   |  Pythagorean triangles   |  |  |  |  A376209
   1   5  [3,4]                   .  X  .  X  .
   3  13  [5,12]                  .  X  .  X  .
   4  17  [8,15]                  X  .  X  .  .
   6  25  [7,24]                  .  X  .  X  .
   7  29  [20,21]                 X  .  X  .  .
   9  37  [12,35]                 X  .  X  .  .
  10  41  [9,40]                  .  X  .  X  .
  13  53  [28,45]                 X  .  X  .  .
  15  61  [11,60]                 .  X  .  X  .
  16  65  [16,63],[33,56],[39,52] X  .  X  X  X
  18  73  [48,55]                 X  .  X  .  .
  21  85  [13,84],[36,77],[51,68] .  X  X  X  X
		

Crossrefs

({A087937}-1)/4 is a subsequence.

Programs

  • PARI
    is_a376210_1(n,r=0) = my(c=4*n+1, q=qfbsolve(Qfb(1,0,1), c^2, 3), qd=#q); if(qd<2, 0, my(a=vecmin(abs(concat(q))[1..2*(qd-1)]), b=sqrtint(c^2-a^2)); a%2==r && gcd([a,b,c])==1)

A180312 Number of solutions to n = x + 4*y + 4*z in triangular numbers.

Original entry on oeis.org

1, 1, 0, 1, 2, 2, 1, 2, 1, 1, 3, 1, 2, 2, 3, 3, 2, 2, 3, 4, 0, 1, 4, 1, 3, 5, 2, 5, 3, 3, 3, 4, 2, 2, 5, 0, 4, 4, 2, 5, 6, 2, 2, 4, 5, 6, 4, 2, 3, 5, 4, 3, 7, 3, 3, 5, 2, 4, 3, 4, 5, 6, 2, 4, 8, 6, 3, 8, 2, 4, 8, 2, 6, 6, 5, 4, 3, 0, 5, 7, 5, 5, 6, 3, 5, 10, 2, 6, 6, 4, 10, 5, 4, 3, 10, 5, 4, 4, 2, 9, 8, 3, 7, 7, 0
Offset: 0

Views

Author

Michael Somos, Aug 25 2010

Keywords

Comments

From page 104 of the Sun reference: "(iii) A positive integer n is a sum of an odd square, an even square and a triangular number, unless it is a triangular number t_m (m>0) for which all prime divisors of 2m+1 are congruent to 1 mod 4 and hence t_m = x^2 + x^2 + t_z for some integers x > 0 and z = x == m/2 (mod 2)."
Numbers of representations of n + 1 as a sum of an odd square, an even square and a triangular number.

Examples

			a(10) = 3 since we have 10 = 6 + 4*1 + 4*0 = 6 + 4*0 + 4*1 = 10 + 4*0 + 4*0.
a(10) = 3 since we have 10 + 1 = 1^2 + 0^2 + 10 = 1 + 2^2 + 6 = 1 + (-2)^2 + 6.
1 + x + x^3 + 2*x^4 + 2*x^5 + x^6 + 2*x^7 + x^8 + x^9 + 3*x^10 + x^11 + ...
		

References

  • Z.-W. Sun, Mixed sums of squares and triangular numbers, Acta Arith. 127(2007), no.2, 103--113, see page 104.

Programs

  • Mathematica
    m=105; psi[q_] = Product[(1-q^(2n))/(1-q^(2n-1)), {n, 1, Floor[m/2]}]; Take[ CoefficientList[ Series[ psi[q]*psi[q^4]^2, {q, 0, m}], q], m] (* Jean-François Alcover, Sep 12 2011, after g.f. *)
  • PARI
    {a(n) = local(A) ; if( n<0, 0, A = x * O(x^n) ; polcoeff( eta(x^2 + A)^2 * eta(x^8 + A)^4 / (eta(x + A) * eta(x^4 + A)^2), n))}

Formula

Expansion of q^(-9/8) * eta(q^2)^2 * eta(q^8)^4 / (eta(q) * eta(q^4)^2) in powers of q
Expansion of psi(q) * psi(q^8) * phi(q^4) = psi(q) * psi(q^4)^2 in powers of q where phi(), psi() are Ramanujan theta functions.
Euler transform of period 8 sequence [ 1, -1, 1, 1, 1, -1, 1, -3, ...].
a(n) = 0 if and only if n+1 = A000217(2 * A094178(m)) for some integer m where A000217 is triangular numbers.
G.f.: (Sum_{k>0} x^((n^2 - n)/2)) * (Sum_{k>0} x^(n^2 - n)).

A376211 Numbers k for which among all possible Pythagorean triangles with the hypotenuse 4*k+1, the minimum of the lengths of the shorter legs is odd.

Original entry on oeis.org

1, 3, 6, 10, 15, 21, 22, 24, 28, 36, 37, 39, 45, 46, 48, 55, 58, 66, 67, 69, 78, 79, 84, 88, 91, 94, 97, 105, 108, 115, 120, 130, 135, 136, 139, 142, 153, 154, 163, 168, 171, 172, 177, 190, 192, 193, 199, 205, 210, 213, 220, 231, 232, 234, 237, 238, 252, 253, 267
Offset: 1

Views

Author

Hugo Pfoertner, Sep 21 2024

Keywords

Examples

			See A376210.
		

Crossrefs

({A087938}-1)/4 is a subsequence.

Programs

  • PARI
    \\ uses function is_a376210_1 from A376210
    is_a376210_1(n,1)
Showing 1-7 of 7 results.