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

A273102 Difference table of the divisors of the positive integers.

Original entry on oeis.org

1, 1, 2, 1, 1, 3, 2, 1, 2, 4, 1, 2, 1, 1, 5, 4, 1, 2, 3, 6, 1, 1, 3, 0, 2, 2, 1, 7, 6, 1, 2, 4, 8, 1, 2, 4, 1, 2, 1, 1, 3, 9, 2, 6, 4, 1, 2, 5, 10, 1, 3, 5, 2, 2, 0, 1, 11, 10, 1, 2, 3, 4, 6, 12, 1, 1, 1, 2, 6, 0, 0, 1, 4, 0, 1, 3, 1, 2, 1, 1, 13, 12, 1, 2, 7, 14, 1, 5, 7, 4, 2, -2, 1, 3, 5, 15, 2, 2, 10, 0, 8, 8
Offset: 1

Views

Author

Omar E. Pol, May 15 2016

Keywords

Comments

This is an irregular tetrahedron T(n,j,k) read by rows in which the slice n lists the elements of the rows of the difference triangle of the divisors of n (including the divisors of n).
The first row of the slice n is also the n-th row of the triangle A027750.
The bottom entry of the slice n is A187202(n).
The sum of the elements of the slice n is A273103(n).
For another version see A273104, from which differs at a(92).
From David A. Corneth, May 20 2016: (Start)
Each element of the difference table of the divisors of n can be expressed in terms of the divisors of n and use of Pascal's triangle. Suppose a, b, c, d and e are the divisors of n. Then the difference table is as follows (rotated for ease of reading):
a
. . b-a
b . . . . c-2b+a
. . c-b . . . . . d-3c+3b-a
c . . . . d-2c+b . . . . . . e-4d+6c-4b+a
. . d-c . . . . . e-3d+3c-b
d . . . . e-2d+c
. . e-d
e
From here we can see Pascal's triangle occurring. Induction can be used to show that it's the case in general.
(End)

Examples

			For n = 18 the divisors of 18 are 1, 2, 3, 6, 9, 18, so the difference triangle of the divisors of 18 is
  1 . 2 . 3 . 6 . 9 . 18
    1 . 1 . 3 . 3 . 9
      0 . 2 . 0 . 6
        2 .-2 . 6
         -4 . 8
           12
and the 18th slice is
  1, 2, 3, 6, 9, 18;
  1, 1, 3, 3, 9;
  0, 2, 0, 6;
  2,-2, 6;
  -4, 8;
  12;
The tetrahedron begins:
  1;
  1, 2;
  1;
  1, 3;
  2;
  1, 2, 4;
  1, 2;
  1;
  ...
This is also an irregular triangle T(n,r) read by rows in which row n lists the difference triangle of the divisors of n flattened. Row lengths are the terms of A184389. Row sums give A273103.
Triangle begins:
  1;
  1, 2, 1;
  1, 3, 2;
  1, 2, 4, 1, 2, 1;
  ...
		

Crossrefs

Programs

  • Mathematica
    Table[Drop[FixedPointList[Differences, Divisors@ n], -2], {n, 15}] // Flatten (* Michael De Vlieger, May 16 2016 *)
  • Sage
    def A273102_DTD(n): # DTD = Difference Table of Divisors
        D = divisors(n)
        T = matrix(ZZ, len(D))
        for (m, d) in enumerate(D):
            T[0, m] = d
            for k in range(m-1, -1, -1) :
                T[m-k, k] = T[m-k-1, k+1] - T[m-k-1, k]
        return [T.row(k)[:len(D)-k] for k in range(len(D))]
    # Keeps the rows of the DTD, for instance
    # A273102_DTD(18)[1] = 1,1,3,3,9 (see the example above).
    for n in range(1,19): print(A273102_DTD(n)) # Peter Luschny, May 18 2016

A272210 Difference table of the divisors of the positive integers (with every table read by antidiagonals upwards).

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 3, 1, 1, 2, 1, 2, 4, 1, 4, 5, 1, 1, 2, 0, 1, 3, 2, 2, 3, 6, 1, 6, 7, 1, 1, 2, 1, 2, 4, 1, 2, 4, 8, 1, 2, 3, 4, 6, 9, 1, 1, 2, 2, 3, 5, 0, 2, 5, 10, 1, 10, 11, 1, 1, 2, 0, 1, 3, 0, 0, 1, 4, 1, 1, 1, 2, 6, 1, 2, 3, 4, 6, 12, 1, 12, 13, 1, 1, 2, 4, 5, 7, -2, 2, 7, 14, 1, 2, 3, 0, 2, 5, 8, 8, 10, 15
Offset: 1

Views

Author

Omar E. Pol, May 18 2016

Keywords

Comments

This is an irregular tetrahedron in which T(n,j,k) is the k-th element of the j-th antidiagonal (read upwards) of the difference table of the divisors of n.
The first row of the slice n is also the n-th row of the triangle A027750.
The bottom entry of the slice n is A187202(n).
The number of elements in the n-th slice is A000217(A000005(n)) = A184389(n).
The sum of the elements of the n-th slice is A273103(n).
The antidiagonal sums give A273262.
If n is a power of 2 the diagonals are also the divisors of the powers of 2 from 1 to n, for example if n = 8 the finite sequence of diagonals is [1], [1, 2], [1, 2, 4], [1, 2, 4, 8].
First differs from A273132 at a(89).

Examples

			The tables of the first nine positive integers are
1; 1, 2; 1, 3; 1, 2, 4; 1, 5; 1, 2, 3, 6; 1, 7; 1, 2, 4, 8; 1, 3, 9;
.  1;    2;    1, 2;    4;    1, 1, 3;    6;    1, 2, 4;    2, 6;
.              1;             0, 2;             1, 2;       4;
.                             2;                1;
.
For n = 18 the difference table of the divisors of 18 is
1, 2, 3, 6, 9, 18;
1, 1, 3, 3, 9;
0, 2, 0, 6;
2, -2, 6;
-4, 8;
12;
This table read by antidiagonals upwards gives the finite subsequence [1], [1, 2], [0, 1, 3], [2, 2, 3, 6], [-4, -2, 0, 3, 9], [12, 8, 6, 6, 9, 18].
		

Crossrefs

Programs

  • Mathematica
    Table[Table[#[[m - k + 1, k]], {m, Length@ #}, {k, m}] &@ NestWhileList[Differences, Divisors@ n, Length@ # > 1 &], {n, 15}] // Flatten (* Michael De Vlieger, Jun 29 2016 *)

A273130 Numbers which have only positive entries in the difference table of their divisors.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 21, 23, 25, 27, 29, 31, 32, 33, 37, 39, 41, 43, 47, 49, 51, 53, 55, 57, 59, 61, 64, 65, 67, 69, 71, 73, 79, 81, 83, 85, 87, 89, 93, 95, 97, 101, 103, 107, 109, 111, 113, 115, 119, 121, 123, 125, 127, 128, 129, 131, 133
Offset: 1

Views

Author

Peter Luschny, May 16 2016

Keywords

Comments

Primes and powers of primes are in the sequence.

Examples

			85 is in the sequence because the difference table of the divisors of 85 has only entries greater than 0:
[1, 5, 17, 85]
[4, 12, 68]
[8, 56]
[48]
		

Crossrefs

Cf. A014567, A187202, A273102, A273103, A273109, A273157 (complement).

Programs

  • Mathematica
    Select[Range@ 1000, {} == NestWhile[ Differences, Divisors @ #, # != {} && Min[#] > 0 &] &] (* Giovanni Resta, May 16 2016 *)
  • PARI
    has(v)=if(#v<2, v[1]>0, if(vecmin(v)<1, 0, has(vector(#v-1,i,v[i+1]-v[i]))))
    is(n)=has(divisors(n)) \\ Charles R Greathouse IV, May 16 2016
  • Sage
    def sf(z):
        D = divisors(z)
        T = matrix(ZZ, len(D))
        for m, d in enumerate(D):
            T[0, m] = d
            for k in range(m-1, -1, -1) :
                T[m-k, k] = T[m-k-1, k+1] - T[m-k-1, k]
                if T[m-k, k] <= 0: return False
        return True
    print([z for z in range(1,100) if sf(z)])
    

A273131 Numbers n such that the bottom entry of the difference table of the divisors of n divides n.

Original entry on oeis.org

1, 2, 4, 6, 8, 12, 14, 16, 24, 32, 64, 128, 152, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, 2147483648
Offset: 1

Views

Author

Omar E. Pol, May 16 2016

Keywords

Comments

All powers of 2 are in the sequence because the bottom entries of their difference triangles are always 1's.
Besides 6, 12, 14, 24 and 152, are there any other non-powers of 2 in this sequence? - David A. Corneth, May 19 2016

Examples

			For n = 14 the difference triangle of the divisors of 14 is
1 . 2 . 7 . 14
. 1 . 5 . 7
. . 4 . 2
. . .-2
The bottom entry is -2 and -2 divides 14, so 14 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[10^6], Function[k, If[k == {0}, False, Divisible[#, First@ k]]]@ NestWhile[Differences, Divisors@ #, Length@ # > 1 &] &] (* Michael De Vlieger, May 17 2016 *)
  • PARI
    isok(n) = {my(d = divisors(n)); my(nd = #d); my(vd = d); for (k=1, nd-1, vd = vector(#vd-1, j, vd[j+1] - vd[j]);); vd[1] && ((n % vd[1]) == 0);} \\ Michel Marcus, May 16 2016
    
  • PARI
    is(n) = my(d=divisors(n),s=sum(i=1,#d,binomial(#d-1,i-1)*(-1)^i*d[i]));if(s!=0,n%s==0) \\ David A. Corneth, May 19 2016
    
  • Sage
    def is_A273131(n):
        D = divisors(n)
        T = matrix(ZZ, len(D))
        for m, d in enumerate(D):
            T[0, m] = d
            for k in range(m-1, -1, -1) :
                T[m-k, k] = T[m-k-1, k+1] - T[m-k-1, k]
        return T[len(D)-1, 0].divides(n)
    print([n for n in range(1, 6000) if is_A273131(n)])
    # Peter Luschny, May 18 2016

Extensions

a(12) = 128 and a(14)-a(25) from Michel Marcus, May 16 2016
a(26)-a(28) from David A. Corneth, May 19 2016
a(29)-a(37) from Lars Blomberg, Oct 18 2016

A273133 a(n) = n minus the bottom entry of the difference table of the divisors of n.

Original entry on oeis.org

0, 1, 1, 3, 1, 4, 1, 7, 5, 10, 1, 11, 1, 16, 7, 15, 1, 6, 1, 31, 13, 28, 1, 36, 9, 34, 19, 31, 1, -20, 1, 31, 25, 46, 7, 47, 1, 52, 31, 106, 1, -62, 1, 31, 21, 64, 1, 151, 13, 66, 43, 31, 1, -34, 19, 8, 49, 82, 1, 727, 1, 88, 71, 63, 25, -6, 1, 31, 61, 148, 1, 12, 1, 106, 11, 31, 13, 22, 1, 439, 65, 118, 1, 1541
Offset: 1

Views

Author

Omar E. Pol, May 17 2016

Keywords

Comments

From David A. Corneth, May 20 2016: (Start)
The bottom of the difference table of the divisors of n can be expressed in terms of the divisors of n and use of Pascal's triangle. Suppose a, b, c, d and e are the divisors of n. Then the difference table is as follows (rotated for ease of reading):
a
. . b-a
b . . . . c-2b+a
. . c-b . . . . . d-3c+3b-a
c . . . . d-2c+b . . . . . . e-4d+6c-4b+a
. . d-c . . . . . e-3d+3c-b
d . . . . e-2d+c
. . e-d
e
From here we can see Pascal's triangle occurring. Induction can be used to show that it's the case in general.
(End)

Examples

			For n = 18 the divisors of 18 are 1, 2, 3, 6, 9, 18, and the difference triangle of the divisors is:
1 . 2 . 3 . 6 . 9 . 18
. 1 . 1 . 3 . 3 . 9
. . 0 . 2 . 0 . 6
. . . 2 .-2 . 6
. . . .-4 . 8
. . . . . 12
The bottom entry is 12, so a(18) = 18 - 12 = 6.
		

Crossrefs

Programs

  • Mathematica
    Array[# - First@ NestWhile[Differences, Divisors@ #, Length@ # > 1 &] &, 84] (* Michael De Vlieger, May 20 2016 *)
  • PARI
    a(n) = my(d=divisors(n));n-sum(i=1,#d,binomial(#d-1,i-1)*(-1)^(#d-i)*d[i]) \\ David A. Corneth, May 20 2016
  • Sage
    def A273133(n):
        D = divisors(n)
        T = matrix(ZZ, len(D))
        for (m, d) in enumerate(D):
            T[0, m] = d
            for k in range(m-1, -1, -1) :
                T[m-k, k] = T[m-k-1, k+1] - T[m-k-1, k]
        return n - T[len(D)-1, 0]
    print([A273133(n) for n in range(1, 85)]) # Peter Luschny, May 18 2016
    

Formula

a(n) = n - A187202(n).
a(n) = 1, if n is prime.
a(2^k) = 2^k - 1 = A000225(k), k >= 0.

A273157 Numbers which have nonpositive entries in the difference table of their divisors (complement of A273130).

Original entry on oeis.org

6, 10, 12, 14, 15, 18, 20, 22, 24, 26, 28, 30, 34, 35, 36, 38, 40, 42, 44, 45, 46, 48, 50, 52, 54, 56, 58, 60, 62, 63, 66, 68, 70, 72, 74, 75, 76, 77, 78, 80, 82, 84, 86, 88, 90, 91, 92, 94, 96, 98, 99, 100, 102, 104, 105, 106, 108, 110, 112, 114, 116, 117
Offset: 1

Views

Author

Peter Luschny, May 16 2016

Keywords

Comments

Primorial numbers (A002110) greater than 2 are in this sequence.

Examples

			30 is in this sequence because the difference table of the divisors of 30 is:
[1, 2, 3, 5, 6, 10, 15, 30]
[1, 1, 2, 1, 4, 5, 15]
[0, 1, -1, 3, 1, 10]
[1, -2, 4, -2, 9]
[-3, 6, -6, 11]
[9, -12, 17]
[-21, 29]
[50]
		

Crossrefs

Cf. A069059, A187202, A273102, A273103, A273109, A273130 (complement).

Programs

  • Sage
    def nsf(z):
        D = divisors(z)
        T = matrix(ZZ, len(D))
        for m, d in enumerate(D):
            T[0, m] = d
            for k in range(m-1, -1, -1) :
                T[m-k, k] = T[m-k-1, k+1] - T[m-k-1, k]
                if T[m-k, k] <= 0: return True
        return False
    print([n for n in range(1, 100) if nsf(n)])
Showing 1-6 of 6 results.