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.

A146208 a(n) is the number of arithmetic progressions of 2 or more integers with product = n.

Original entry on oeis.org

4, 6, 6, 4, 10, 4, 11, 8, 10, 4, 12, 4, 8, 12, 12, 4, 12, 4, 12, 10, 8, 4, 26, 6, 8, 9, 14, 4, 16, 4, 13, 8, 8, 10, 20, 4, 8, 8, 20, 4, 18, 4, 12, 16, 8, 4, 26, 6, 12, 8, 12, 4, 16, 10, 16, 8, 8, 4, 26, 4, 8, 14, 19, 8, 18, 4, 12, 8, 16, 4, 24, 4, 8, 12
Offset: 2

Views

Author

Naohiro Nomoto, Oct 28 2008

Keywords

Comments

a(n)=number of all integer triples (x,y,z) such that Product_{k=0..z} (x + (y*k)) = n, where n>1, z>0.

Examples

			a(8) = 11 as we can have
 (x=-8,y=7,z=1; -8 * -1),
 (x=-4,y=2,z=1; -4 * -2),
 (x=-4,y=3,z=2; -4 * -1 * 2),
 (x=-2,y=-2,z=1; -2 * -4),
 (x=-1,y=-7,z=1; -1 * -8),
 (x=1,y=7,z=1; 1 * 8),
 (x=2,y=-3,z=2; 2 * -1 * -4),
 (x=2,y=0,z=2; 2 * 2 * 2),
 (x=2,y=2,z=1; 2 * 4),
 (x=4,y=-2,z=1; 4 * 2),
 (x=8,y=-7,z=1; 8 * 1). - Example added by _Antti Karttunen_, Feb 28 2023
a(9) = 8 as we can have
 (x=-3,y=0,z=1; -3 * -3),
 (x=3,y=0,z=1; 3 * 3),
 (x=-9,y=8,z=1; -9 * -1),
 (x=1,y=8,z=1; 1 * 9),
 (x=-1,y=-8,z=1; -1 * -9),
 (x=9,y=-8,z=1; 9 * 1),
 (x=3,y=-2,z=3; 3 * 1 * -1 * -3),
 (x=-3,y=2,z=3; -3 * -1 * 1 * 3).
		

Crossrefs

Programs

  • PARI
    A146208(n) = sum(x=-n,n,sum(y=-n,n,sum(z=1,n,n==prod(k=0,z,x+(y*k))))); \\ (Slow!) - Antti Karttunen, Feb 28 2023
    
  • Python
    from sympy import divisors
    def A146208(n):
        ds = divisors(n)
        c, s = 0, [-d for d in ds[::-1]]+ds
        for x in s:
            d2 = [d//x for d in ds if d%x==0]
            for y in (f-x for f in [-d for d in d2[::-1]]+d2):
                m, k = x*(z:=x+y), 1
                while n >= abs(m) and k<=n:
                    if n == m:
                        c += 1
                    z += y
                    m *= z
                    k += 1
        return c # Chai Wah Wu, May 11 2023

Formula

a(n) = A062011(n) + A361015(n). - Antti Karttunen, Feb 28 2023