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-10 of 35 results. Next

A056534 Mapping from the ordering by product (A027750, A056538) to the ordering by sum (A002260, A004736) of ordered pairs (a,b), a>=1, b>=1.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 5, 10, 11, 15, 16, 8, 9, 21, 22, 28, 29, 12, 14, 36, 37, 13, 45, 46, 17, 20, 55, 56, 66, 67, 23, 18, 19, 27, 78, 79, 91, 92, 30, 35, 105, 106, 24, 26, 120, 121, 38, 25, 44, 136, 137, 153, 154, 47, 31, 34, 54, 171, 172, 190, 191, 57, 32, 33, 65, 210, 211, 39
Offset: 1

Views

Author

Antti Karttunen, Jun 20 2000

Keywords

Examples

			The "ordering by sum": (1,1),(1,2),(2,1),(1,3),(2,2),(3,1),(1,4),(2,3),(3,2),(4,1),...
The "ordering by product": (1,1),(1,2),(2,1),(1,3),(3,1),(1,4),(2,2),(4,1),(1,5),(5,1),...
		

Crossrefs

Inverse: A056535.

Programs

  • Maple
    ordered_pair_perm := proc(upto_n) local a,i,j; a := []; for i from 1 to upto_n do for j in sort(divisors(i)) do a := [op(a),binomial(((i/j) + j - 1),2)+j]; od; od; RETURN(a); end;
  • Mathematica
    max = 21; A056534 = {}; For[i = 1, i <= max, i++, Do[ AppendTo[ A056534, Binomial[i/j + j - 1, 2] + j], {j, Divisors[i]}]]; A056534 (* Jean-François Alcover, Oct 05 2012, after Maple *)

A027750 Triangle read by rows in which row n lists the divisors of n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Or, in the list of natural numbers (A000027), replace n with its divisors.
This gives the first elements of the ordered pairs (a,b) a >= 1, b >= 1 ordered by their product ab.
Also, row n lists the largest parts of the partitions of n whose parts are not distinct. - Omar E. Pol, Sep 17 2008
Concatenation of n-th row gives A037278(n). - Reinhard Zumkeller, Aug 07 2011
{A210208(n,k): k=1..A073093(n)} subset of {T(n,k): k=1..A000005(n)} for all n. - Reinhard Zumkeller, Mar 18 2012
Row sums give A000203. Right border gives A000027. - Omar E. Pol, Jul 29 2012
Indices of records are in A006218. - Irina Gerasimova, Feb 27 2013
The number of primes in the n-th row is omega(n) = A001221(n). - Michel Marcus, Oct 21 2015
The row polynomials P(n,x) = Sum_{k=1..A000005(n)} T(n,k)*x^k with composite n which are irreducible over the integers are given in A292226. - Wolfdieter Lang, Nov 09 2017
T(n,k) is also the number of parts in the k-th partition of n into equal parts (see example). - Omar E. Pol, Nov 20 2019
Let there be an infinite number of tiles, each labeled with a positive integer m, initially placed on square m of an infinite 1D board. At step n, the leftmost unblocked tile (i.e., the top tile of the leftmost nonempty stack) moves forward exactly m squares, where m is its label. Tiles that land on the same square form a stack, and only the top tile of any stack may move. This sequence records the label m of the tile that moves at step n. - Ali Sada, May 23 2025
All divisors of a positive integer n form a finite set. Extending divisibility to n = 0 by using the definition (k|n <=> exists m such that m*k = n) makes the set of divisors infinite, suggesting the definition was not intended for zero, as arithmetic functions typically apply to n >= 1. So to preserve a core property when generalizing (cardinality), one can define divisors of n >= 0 as the fixed points of the greatest common divisor on the set [n] = {0, 1, 2, ..., n}. By this definition, the divisors of 0 are {0}, since 0|0 and gcd(0, 0) = 0. This definition is not circular because the gcd can be effectively calculated using the Euclidean algorithm. (Cf. links.) - Peter Luschny, Jun 02 2025

Examples

			Triangle begins:
  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, 5, 10;
  1, 11;
  1, 2, 3, 4, 6, 12;
  ...
For n = 6 the partitions of 6 into equal parts are [6], [3,3], [2,2,2], [1,1,1,1,1,1], so the number of parts are [1, 2, 3, 6] respectively, the same as the divisors of 6. - _Omar E. Pol_, Nov 20 2019
		

Crossrefs

Cf. A000005 (row length), A001221, A027749, A027751, A056534, A056538, A127093, A135010, A161700, A163280, A240698 (partial sums of rows), A240694 (partial products of rows), A247795 (parities), A292226, A244051.

Programs

  • Haskell
    a027750 n k = a027750_row n !! (k-1)
    a027750_row n = filter ((== 0) . (mod n)) [1..n]
    a027750_tabf = map a027750_row [1..]
    -- Reinhard Zumkeller, Jan 15 2011, Oct 21 2010
    
  • Magma
    [Divisors(n) : n in [1..20]];
    
  • Maple
    seq(op(numtheory:-divisors(a)), a = 1 .. 20) # Matt C. Anderson, May 15 2017
  • Mathematica
    Flatten[ Table[ Flatten [ Divisors[ n ] ], {n, 1, 30} ] ]
  • PARI
    v=List();for(n=1,20,fordiv(n,d,listput(v,d)));Vec(v) \\ Charles R Greathouse IV, Apr 28 2011
    
  • Python
    from sympy import divisors
    for n in range(1, 16):
        print(divisors(n)) # Indranil Ghosh, Mar 30 2017

Formula

a(A006218(n-1) + k) = k-divisor of n, 1 <= k <= A000005(n). - Reinhard Zumkeller, May 10 2006
T(n,k) = n / A056538(n,k) = A056538(n,n-k+1), 1 <= k <= A000005(n). - Reinhard Zumkeller, Sep 28 2014

Extensions

More terms from Scott Lindhurst (ScottL(AT)alumni.princeton.edu)

A056539 Self-inverse permutation: reverse the bits in binary expansion of n and also complement them (0->1, 1->0) if the run count (A005811) is even.

Original entry on oeis.org

0, 1, 2, 3, 6, 5, 4, 7, 14, 9, 10, 13, 12, 11, 8, 15, 30, 17, 22, 25, 26, 21, 18, 29, 28, 19, 20, 27, 24, 23, 16, 31, 62, 33, 46, 49, 54, 41, 38, 57, 58, 37, 42, 53, 50, 45, 34, 61, 60, 35, 44, 51, 52, 43, 36, 59, 56, 39, 40, 55, 48, 47, 32, 63, 126, 65, 94, 97, 110, 81, 78
Offset: 0

Views

Author

Antti Karttunen, Jun 20 2000

Keywords

Examples

			n:                     0, 1,  2,  3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,  14,  15
binary expansion:      0, 1, 10, 11, 100, 101, 110, 111,1000,1001,1010,1011,1100,1101,1110,1111
reversed/complemented: 0, 1, 10, 11, 110, 101, 100, 111,1110,1001,1010,1101,1100,1011,1000,1111
		

Crossrefs

Cf. A054429.
When restricted to A014486 induces another permutation, A057164. A105726 is a "deep" variant.

Programs

  • Maple
    [seq(runcounts2binexp(reverse(binexp2runcounts(j))),j=0..511)];
    runcounts2binexp := proc(c) local i,e,n; n := 0; for i from 1 to nops(c) do e := c[i]; n := ((2^e)*n) + ((i mod 2)*((2^e)-1)); od; RETURN(n); end;
    binexp2runcounts := proc(nn) local n,a,p,c; n := nn; a := []; p := (`mod`(n,2)); c := 0; while(n > 0) do c := c+1; n := floor(n/2); if((`mod`(n,2)) <> p) then a := [c,op(a)]; c := 0; p := (`mod`(p+1,2)); fi; od; RETURN(a); end;
    # reverse given in A056538
  • Mathematica
    A056539[n_] := If[n == 0, 0, FromDigits[Reverse[If[Last[#] == 1, #, 1-#]], 2] & [IntegerDigits[n, 2]]];
    Array[A056539, 100, 0] (* Paolo Xausa, Nov 28 2024 *)
  • Python
    def a005811(n): return bin(n^(n>>1))[2:].count("1")
    def a(n):
        if n==0: return 0
        x=bin(n)[2:][::-1]
        if a005811(n)%2==1: return int(x, 2)
        z=''.join('1' if i == '0' else '0' for i in x)
        return int(z, 2) # Indranil Ghosh, Apr 29 2017

Formula

a(2n) = A036044(2n), a(2n+1) = A030101(2n+1). - Antti Karttunen, Feb 14 2003

A071324 Alternating sum of all divisors of n; divisors nonincreasing, starting with n.

Original entry on oeis.org

1, 1, 2, 3, 4, 4, 6, 5, 7, 6, 10, 8, 12, 8, 12, 11, 16, 13, 18, 12, 16, 12, 22, 16, 21, 14, 20, 18, 28, 22, 30, 21, 24, 18, 32, 25, 36, 20, 28, 24, 40, 32, 42, 30, 36, 24, 46, 32, 43, 31, 36, 36, 52, 40, 48, 38, 40, 30, 58, 40, 60, 32, 46, 43, 56, 48, 66, 48, 48, 42, 70, 49, 72
Offset: 1

Views

Author

Reinhard Zumkeller, May 18 2002, Jul 03 2008

Keywords

Comments

Alternating row sums of A056538. - Omar E. Pol, Feb 17 2024
Does a constant analogous to the median abundancy index (see A353617) exist for this function? Particularly, does a constant exist such that the numbers having the value a(n)/n greater than this constant have natural density exactly 1/2? Using the first 10^7 values, one observes that if it exists, this constant appears to converge around 0.726. - Shreyansh Jaiswal, Apr 16 2025

Examples

			Divisors of 20: {1,2,4,5,10,20} therefore a(20) = 20 - 10 + 5 - 4 + 2 - 1 = 12.
		

Crossrefs

Cf. A000010, A000203, A071322, a(n) = abs(A071323(n)).
Cf. A056538.

Programs

  • Maple
    with(numtheory): a:=proc(n) local k, t:=0, A:=divisors(n); for k to tau(n) do t:= t+A[k]*(-1)^(tau(n)-k) end do; return t; end proc; seq(a(n), n=1..60); # Ridouane Oudra, Nov 23 2022
  • Mathematica
    a[n_] := Plus @@ (-(d = Divisors[n])*(-1)^(Range[Length[d],1,-1])); Array[a, 100] (* Amiram Eldar, Mar 11 2020 *)
    Table[Total[Times@@@Partition[Riffle[Reverse[Divisors[n]],{1,-1},{2,-1,2}],2]],{n,80}] (* Harvey P. Dale, Nov 06 2022 *)
  • PARI
    a(n) = my(d=Vecrev(divisors(n))); sum(k=1, #d, (-1)^(k+1)*d[k]); \\ Michel Marcus, Aug 11 2018
    (APL, Dyalog dialect)
    divisors ← {⍺←⍵{(0=⍵|⍺)/⍵}⍳⌊⍵*÷2 ⋄ 1=⍵:⍺ ⋄ ⍺,(⍵∘÷)¨(⍵=(⌊⍵*÷2)*2)↓⌽⍺}
    A071324 ← {-/⌽(divisors ⍵)} ⍝ Antti Karttunen, Feb 16 2024
    
  • Python
    from sympy import divisors;  from functools import lru_cache
    cached_divisors = lru_cache()(divisors)
    def a(n):  return sum(d if i%2==0 else -d for i, d in enumerate(reversed(cached_divisors(n))))
    A071324 = [a(i) for i in range(1, 74)]  # Jwalin Bhatt, Apr 02 2025

Formula

a(A028983(n)) mod 2 = 0; a(A028982(n)) mod 2 = 1.
a(n) = Sum_{i=1..n} (A135539(n,i) mod 2). - Ridouane Oudra, Nov 23 2022
From Shreyansh Jaiswal, Apr 16 2025: (Start)
a(p) = p-1 for prime p.
For odd n, 2n/3 <= a(n) <= n.
For even n, n/2 <= a(n) <= 5n/6.
a(n) >= A000010(n) for n>=1. (End)

A064896 Numbers of the form (2^(m*r)-1)/(2^r-1) for positive integers m, r.

Original entry on oeis.org

1, 3, 5, 7, 9, 15, 17, 21, 31, 33, 63, 65, 73, 85, 127, 129, 255, 257, 273, 341, 511, 513, 585, 1023, 1025, 1057, 1365, 2047, 2049, 4095, 4097, 4161, 4369, 4681, 5461, 8191, 8193, 16383, 16385, 16513, 21845, 32767, 32769, 33825, 37449, 65535, 65537
Offset: 1

Views

Author

Marc LeBrun, Oct 11 2001

Keywords

Comments

Binary expansion of n consists of single 1's diluted by (possibly empty) equal-sized blocks of 0's.
According to Stolarsky's Theorem 2.1, all numbers in this sequence are sturdy numbers; this sequence is a subsequence of A125121. - T. D. Noe, Jul 21 2008
These are the numbers k > 0 for which k + 2^m = k*2^n + 1 has a solution m,n > 0. For k > 1, these are numbers k such that (k - 2^x)*2^y + 1 = k has a solution in positive integers x,y. In other words, (k - 1)/(k - 2^x) = 2^y for some x,y > 0. If t = (2^m - 1)/(2^n - 1) is a term of this sequence (i.e. if and only if n|m), then t' = t + 2^m = t*2^n + 1 is also a term. Primes in this sequence (A245730) include: all Mersenne primes (A000668), all Fermat primes (A019434), and other primes (73, 262657, 4432676798593, ...). - Thomas Ordowski, Feb 14 2024

Examples

			73 is included because it is 1001001 in binary, whose 1's are diluted by blocks of two 0's.
		

Crossrefs

Cf. A076270 (k=3), A076275 (k=4), A076284 (k=5), A076285 (k=6), A076286 (k=7), A076287 (k=8), A076288 (k=9), A076289 (k=10).
Primes in this sequence: A245730.

Programs

  • Maple
    f := proc(p) local m,r,t1; t1 := {}; for m from 1 to 10 do for r from 1 to 10 do t1 := {op(t1), (p^(m*r)-1)/(p^r-1)}; od: od: sort(convert(t1,list)); end; f(2); # very crude!
    # Alternative:
    N:= 10^6: # to get all terms <= N
    A:= sort(convert({1,seq(seq((2^(m*r)-1)/(2^r-1),m=2..1/r*ilog2(N*(2^r-1)+1)),r=1..ilog2(N-1))},list)); # Robert Israel, Jun 12 2015
  • PARI
    lista(nn) = {v = [1]; x = (2^nn-1); for (m=2, nn, r = 1; while ((y = (2^(m*r)-1)/(2^r-1)) <=x, v = Set(concat(v, y)); r++);); v;} \\ Michel Marcus, Jun 12 2015

Formula

A064894(a(n)) = A056538(n).

A061017 List in which n appears d(n) times, where d(n) [A000005] is the number of divisors of n.

Original entry on oeis.org

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

Views

Author

Jont Allen (jba(AT)research.att.com), May 25 2001

Keywords

Comments

The union of N, 2N, 3N, ..., where N = {1, 2, 3, 4, 5, 6, ...}. In other words, the numbers {m*n, m >= 1, n >= 1} sorted into nondecreasing order.
Considering the maximal rectangle in each of the Ferrers graphs of partitions of n, a(n) is the smallest such maximal rectangle; a(n) is also an inverse of A006218. - Henry Bottomley, Mar 11 2002
The numbers in A003991 arranged in numerical order. - Matthew Vandermast, Feb 28 2003
Least k such that tau(1) + tau(2) + tau(3) + ... + tau(k) >= n. - Michel Lagneau, Jan 04 2012
The number 1 appears only once, primes appear twice, squares of primes appear thrice. All other positive integers appear at least four times. - Alonso del Arte, Nov 24 2013

Examples

			Array begins:
   1
   2  2
   3  3
   4  4  4
   5  5
   6  6  6  6
   7  7
   8  8  8  8
   9  9  9
  10 10 10 10
  11 11
  12 12 12 12 12 12
  13 13
  14 14 14 14
  15 15 15 15
  16 16 16 16 16
  17 17
  18 18 18 18 18 18
  19 19
  20 20 20 20 20 20
  21 21 21 21
  22 22 22 22
  23 23
  24 24 24 24 24 24 24 24
		

Crossrefs

Cf. A000005. An inverse to A006218.

Programs

  • Maple
    with(numtheory); t1:=[]; for i from 1 to 1000 do for j from 1 to tau(i) do t1:=[op(t1),i]; od: od: t1:=sort(t1);
  • Mathematica
    Flatten[Table[Table[n, {Length[Divisors[n]]}], {n, 30}]]
  • PARI
    a(n)=if(n<0,0,t=1;while(sum(k=1,t,floor(t/k))Benoit Cloitre, Nov 08 2009

Formula

a(n) >= pi(n+1) for all n; a(n) >= pi(n) + 1 for all n >= 24 (cf. A098357, A088526, A006218, A052511). - N. J. A. Sloane, Oct 22 2008
a(n) = A027750(n) * A056538(n). - Charles Kusniec, Jan 21 2021
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi^2/12 (A072691). - Amiram Eldar, Jan 14 2024

Extensions

More terms from Erich Friedman, Jun 01 2001

A244051 Triangle read by rows in which row n lists the parts of the partitions of n into equal parts, in nonincreasing order.

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Nov 08 2014

Keywords

Comments

Row n has length sigma(n) = A000203(n).
Row sums give n*A000005(n) = A038040(n).
Column 1 is A000027.
Both columns 2 and 3 are A032742, n > 1.
For any k > 0 and t > 0, the sequence contains exactly one run of k consecutive t's. - Rémy Sigrist, Feb 11 2019
From Omar E. Pol, Dec 04 2019: (Start)
The number of parts congruent to 0 (mod m) in row m*n equals sigma(n) = A000203(n).
The number of parts greater than 1 in row n equals A001065(n), the sum of aliquot parts of n.
The number of parts greater than 1 and less than n in row n equals A048050(n), the sum of divisors of n except for 1 and n.
The number of partitions in row n equals A000005(n), the number of divisors of n.
The number of partitions in row n with an odd number of parts equals A001227(n).
The sum of odd parts in row n equals the sum of parts of the partitions in row n that have an odd number of parts, and equals the sum of all parts in the partitions of n into consecutive parts, and equals A245579(n) = n*A001227(n).
The decreasing records in row n give the n-th row of A056538.
Row n has n 1's which are all at the end of the row.
First n rows contain A000217(n) 1's.
The number of k's in row n is A126988(n,k).
The number of odd parts in row n is A002131(n).
The k-th block in row n has A027750(n,k) parts.
Right border gives A000012. (End)
The r-th row of the triangle begins at index k = A160664(r-1). - Samuel Harkness, Jun 21 2022

Examples

			Triangle begins:
   [1];
   [2], [1,1];
   [3], [1,1,1];
   [4], [2,2], [1,1,1,1];
   [5], [1,1,1,1,1];
   [6], [3,3], [2,2,2], [1,1,1,1,1,1];
   [7], [1,1,1,1,1,1,1];
   [8], [4,4], [2,2,2,2], [1,1,1,1,1,1,1,1];
   [9], [3,3,3], [1,1,1,1,1,1,1,1,1];
  [10], [5,5], [2,2,2,2,2], [1,1,1,1,1,1,1,1,1,1];
  [11], [1,1,1,1,1,1,1,1,1,1,1];
  [12], [6,6], [4,4,4], [3,3,3,3], [2,2,2,2,2,2], [1,1,1,1,1,1,1,1,1,1,1,1];
  [13], [1,1,1,1,1,1,1,1,1,1,1,1,1];
  [14], [7,7], [2,2,2,2,2,2,2], [1,1,1,1,1,1,1,1,1,1,1,1,1,1];
  [15], [5,5,5], [3,3,3,3,3], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
  [16], [8,8], [4,4,4,4], [2,2,2,2,2,2,2,2], [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];
  ...
For n = 6 the 11 partitions of 6 are [6], [3, 3], [4, 2], [2, 2, 2], [5, 1], [3, 2], [4, 1, 1], [2, 2, 1, 1], [3, 1, 1, 1], [2, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1]. There are only four partitions of 6 that contain equal parts so the 6th row of triangle is [6], [3, 3], [2, 2, 2], [1, 1, 1, 1, 1, 1]. The number of parts equals sigma(6) = A000203(6) = 12. The row sum is A038040(6) = 6*A000005(6) = 6*4 = 24.
From _Omar E. Pol_, Dec 04 2019: (Start)
The structure of the above triangle is as follows:
   1;
   2 11;
   3    111;
   4 22     1111;
   5             11111;
   6 33 222            111111;
   7                          1111111;
   8 44     2222                      11111111;
   9    333                                    111111111;
  ... (End)
		

Crossrefs

Programs

  • Mathematica
    A244051row[n_]:=Flatten[Map[ConstantArray[#,n/#]&,Reverse[Divisors[n]]]];
    Array[A244051row,10] (* Paolo Xausa, Oct 16 2023 *)
  • PARI
    tabf(nn) = {for (n=1, nn, d = Vecrev(divisors(n)); for (i=1, #d, for (j=1, n/d[i], print1(d[i], ", "));); print(););} \\ Michel Marcus, Nov 08 2014

A187215 Sum of the elements of the absolute difference table of the divisors of n.

Original entry on oeis.org

1, 4, 6, 11, 10, 21, 14, 26, 25, 31, 22, 52, 26, 45, 54, 57, 34, 82, 38, 82, 72, 73, 46, 119, 71, 87, 90, 108, 58, 161, 62, 120, 108, 115, 134, 181, 74, 129, 126, 193, 82, 221, 86, 172, 218, 157, 94, 252, 141, 190, 162, 204, 106, 285, 202, 233
Offset: 1

Views

Author

Omar E. Pol, Aug 02 2011

Keywords

Comments

First differs from A273103 at a(14). - Omar E. Pol, May 15 2016

Examples

			For n = 14 the divisors of 14 are 1, 2, 7, 14, and the absolute difference triangle of the divisors is
1 . 2 . 7 . 14
. 1 . 5 . 7
. . 4 . 2
. . . 2
The sum of all elements of the triangle is 1 + 2 + 7 + 14 + 1 + 5 + 7 + 4 + 2 + 2 = 45, so a(14) = 45.
		

Crossrefs

Row sums of triangle A187207.

Programs

  • Maple
    with(numtheory):
    DD:= l-> [seq(abs(l[i]-l[i-1]), i=2..nops(l))]:
    a:= proc(n) local l;
          l:= sort([divisors(n)[]], `>`);
          add(j, j=[seq((DD@@i)(l)[], i=0..nops(l)-1)]);
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Aug 02 2011
  • Mathematica
    Table[Total@ Flatten@ NestWhileList[Abs@ Differences@ # &, Divisors@ n, Length@ # > 1 &], {n, 56}] (* Michael De Vlieger, May 18 2016 *)

Formula

a(n) = 2n, if n is prime.
a(2^k) = A125128(k+1), k >= 0. - Omar E. Pol, May 15 2016

Extensions

More terms from Alois P. Heinz, Aug 02 2011
Edited by Omar E. Pol, May 19 2016

A168017 Triangle read by rows in which row n lists the number of partitions of n into parts divisible by d, where d is a divisor of n listed in decreasing order.

Original entry on oeis.org

1, 1, 2, 1, 3, 1, 2, 5, 1, 7, 1, 2, 3, 11, 1, 15, 1, 2, 5, 22, 1, 3, 30, 1, 2, 7, 42, 1, 56, 1, 2, 3, 5, 11, 77, 1, 101, 1, 2, 15, 135, 1, 3, 7, 176, 1, 2, 5, 22, 231, 1, 297, 1, 2, 3, 11, 30, 385, 1, 490, 1, 2, 5, 7, 42, 627, 1, 3, 15, 792, 1, 2, 56, 1002
Offset: 1

Views

Author

Omar E. Pol, Nov 22 2009

Keywords

Comments

Positive values of triangle A168016.
The number of terms of row n is equal to the number of divisors of n: A000005(n).
Note that the last term of each row is the number of partitions of n: A000041(n).
Also, it appears that row n lists the partition numbers of the divisors of n. [Omar E. Pol, Nov 23 2009]

Examples

			Consider row n=8: (1, 2, 5, 22). The divisors of 8 listed in decreasing order are 8, 4, 2, 1 (see A056538). There is 1 partition of 8 into parts divisible by 8. Also, there are 2 partitions of 8 into parts divisible by 4: {(8), (4+4)}; 5 partitions of 8 into parts divisible by 2: {(8), (6+2), (4+4), (4+2+2), (2+2+2+2)}; and 22 partitions of 8 into parts divisible by 1, because A000041(8)=22. Then row 8 is formed by 1, 2, 5, 22.
Triangle begins:
1;
1,  2;
1,  3;
1,  2,  5;
1,  7;
1,  2,  3, 11;
1, 15;
1,  2,  5, 22;
1,  3, 30;
1,  2,  7, 42;
1, 56;
1,  2,  3,  5, 11, 77;
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    b:= proc(n, i, d) option remember;
          if n<0 then 0
        elif n=0 then 1
        elif i<1 then 0
        else b(n, i-d, d) +b(n-i, i, d)
          fi
        end:
    T:= proc(n) local l;
          l:= sort([divisors(n)[]],`>`);
          seq(b(n, n, l[i]), i=1..nops(l))
        end:
    seq(T(n), n=1..30); # Alois P. Heinz, Oct 21 2011
  • Mathematica
    b[n_, i_, d_] := b[n, i, d] = Which[n<0, 0, n==0, 1, i<1, 0, True, b[n, i - d, d] + b[n-i, i, d]]; T[n_] := Module[{l = Divisors[n] // Reverse}, Table[b[n, n, l[[i]]], {i, 1, Length[l]}]]; Table[T[n], {n, 1, 30}] // Flatten (* Jean-François Alcover, Dec 03 2015, after Alois P. Heinz *)

A299481 Irregular triangle read by rows in which row n lists the odd divisors of n in decreasing order together with the even divisors of n in increasing order.

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Feb 10 2018

Keywords

Comments

Consider the diagram with overlapping periodic curves that appears in the Links section (figure 1). The number of curves that contain the point [n,0] equals the number of divisors of n. The simpler interpretation of the diagram is that the curve of diameter d represents the divisor d of n. Now here we introduce a new interpretation: the curve of diameter d that contains the point [n,0] represents the divisor c of n, where c = n/d. This version of the model has the property that each odd quadrant centered at [n,0] contains the curves that represent the even divisors of n, and each even quadrant centered at [n,0] contains the curves that represent the odd divisors of n.
We can find the n-th row of the triangle as follows:
Consider only the semicircumferences that contain the point [n,0].
In the second quadrant from bottom to top we can see the curves that represent the odd divisors of n in decreasing order. Also we can see these curves in the fourth quadrant from top to bottom.
Then, if n is an even number, in the first quadrant from top to bottom we can see the curves that represent the even divisors of n in increasing order. Also we can see these curves in the third quadrant from bottom to top (see example).
Sequences of the same family are shown below:
-----------------------------------
Triangle Order of divisors of n
-----------------------------------
This seq. odd v t.w. even ^
A299483 odd ^ t.w. even v
A319844 even v t.w. odd ^
A319845 even ^ t.w. odd v
A319846 odd v t.w. even v
A319847 odd ^ t.w. even ^
A319848 even v t.w. odd v
A319849 even ^ t.w. odd ^
-----------------------------------
In the above table we have that:
"even v" means "even divisors of n in decreasing order".
"even ^" means "even divisors of n in increasing order".
"odd v" means "odd divisors of n in decreasing order".
"odd ^" means "odd divisors of n in increasing order".
"t.w." means "together with".

Examples

			Triangle begins:
   1;
   1,  2;
   3,  1;
   1,  2,  4;
   5,  1;
   3,  1,  2,  6;
   7,  1;
   1,  2,  4,  8;
   9,  3,  1;
   5,  1,  2, 10;
  11,  1;
   3,  1,  2,  4,  6, 12;
  13,  1;
   7,  1,  2, 14;
  15,  5,  3,  1;
   1,  2,  4,  8, 16;
  17,  1;
   9,  3,  1,  2,  6, 18;
  19,  1;
   5,  1,  2,  4, 10, 20;
  21,  7,  3,  1;
  11,  1,  2, 22;
  23,  1;
   3,  1,  2,  4,  6,  8, 12, 24;
  25,  5,  1;
  13,  1,  2, 26;
  27,  9,  3,  1;
   7,  1,  2,  4, 14, 28;
...
For n = 12 the divisors of 12 are [1, 2, 3, 4, 6, 12]. The odd divisors of 12 in decreasing order are [3, 1], and the even divisors of 12 in increasing order are [2, 4, 6, 12], so the 12th row of triangle is [3, 1, 2, 4, 6, 12].
On the other hand, consider the diagram that appears in the Links section (figure 1). Then consider only the semicircumferences that contain the point [12,0]. In the second quadrant, from bottom to top, we can see the curves with diameters [4, 12]. Also we can see these curves in the fourth quadrant from top to bottom. The associated numbers c = 12/d are [3, 1] respectively. These are the odd divisors of 12 in decreasing order. Then, in the first quadrant, from top to bottom, we can see the curves with diameters [6, 3, 2, 1]. Also we can see these curves in the third quadrant from bottom to top. The associated numbers c = 12/d are [2, 4, 6, 12] respectively. These are the even divisors of n in increasing order. Finally all numbers c obtained are [3, 1, 2, 4, 6, 12] equaling the 12th row of triangle.
		

Crossrefs

Row sums give A000203.
Row n has length A000005(n).
Alternating borders give A000027.
Right border gives A124625 without its first two terms.

Programs

  • PARI
    row(n) = my(d=divisors(n)); concat(Vecrev(select(x->(x%2), d)), select(x->!(x%2), d));
    lista(nn) = {for (n=1, nn, my(r = row(n)); for (k=1, #r, print1(r[k], ", ")););} \\ Michel Marcus, Jan 17 2019
Showing 1-10 of 35 results. Next