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.

Previous Showing 11-15 of 15 results.

A125168 a(n) = gcd(n, A032741(n)) where A032741(n) is the number of proper divisors of n.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 3, 4, 1, 1, 1, 5, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 4, 1, 1, 3, 1, 1, 7, 1, 1, 5, 1, 1, 3, 1, 5, 3, 1, 1, 1, 1, 7, 3, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 3, 7, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 7
Offset: 1

Views

Author

Mitch Cervinka (puritan(AT)toast.net), Jan 12 2007

Keywords

Comments

First occurrence of k: 1, 4, 6, 16, 20, 3240000, 42, 256, 162, 18662400, 132, 5308416, 832, 784, 120, 65536, 612, 2985984, 912, 1600, 9240, 98010000, 1380, 1296, 100800, ..., (10^7). - Robert G. Wilson v, Jan 23 2007
Do all values appear? - Robert G. Wilson v, Jan 23 2007
From Bernard Schott, Oct 19 2019: (Start)
a(n) = 1 if n = p^k, p prime, k >= 0 and k <> p or,
n = p*q, p 3 or
n = p*q*r, p 7 or,
n = p^2*q, p 5 or
n = p^3*q, p 7.
a(n) = 2 if n = 2^2 or n = 2^(2*p), p prime <> 2,
a(n) = 3 if n = 3*p, p prime <> 3 or n = 3^3,
a(n) = 4 if n = 4*p^2, p prime,
a(n) = 5 if n = 5*p^2, p prime <> 5, or n = 25*p, p prime <> 5, or n = 5^5,
a(n) = 7 if n = 7*p*q with p 7 or n = 7*p^3, p prime <> 7, or n = 7^7,
a(n) = p if n = p^p, p prime. (End)

Examples

			a(6)=3 because 6 has 3 proper divisors {1,2,3} and gcd(6,3) is 3.
		

Crossrefs

Programs

Formula

a(n) = gcd(n, A032741(n)) = gcd(n, A062968(n)).

Extensions

More terms from Robert G. Wilson v, Jan 23 2007

A059292 a(n) = n + 2 - (number of divisors of n).

Original entry on oeis.org

2, 2, 3, 3, 5, 4, 7, 6, 8, 8, 11, 8, 13, 12, 13, 13, 17, 14, 19, 16, 19, 20, 23, 18, 24, 24, 25, 24, 29, 24, 31, 28, 31, 32, 33, 29, 37, 36, 37, 34, 41, 36, 43, 40, 41, 44, 47, 40, 48, 46, 49, 48, 53, 48, 53, 50, 55, 56, 59, 50, 61, 60, 59, 59, 63, 60, 67
Offset: 1

Views

Author

N. J. A. Sloane, Jan 25 2001

Keywords

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 121, see #17.

Crossrefs

Cf. A000005, A049820, A062968. - Omar E. Pol, Jul 16 2009

Programs

  • Magma
    [n+2-DivisorSigma(0, n): n in [1..100]]; // Vincenzo Librandi, Jan 05 2017
  • Mathematica
    Table[n + 2 - DivisorSigma[0, n], {n,1,100}] (* G. C. Greubel, Jan 04 2017 *)
  • PARI
    a(n) = { n + 2 - numdiv(n) } \\ Harry J. Smith, Jun 25 2009
    

Formula

a(n) = n + 2 - A000005(n) = A049820(n) + 2. - Omar E. Pol, Jul 16 2009

A342194 Number of strict compositions of n with equal differences, or strict arithmetic progressions summing to n.

Original entry on oeis.org

1, 1, 1, 3, 3, 5, 7, 7, 7, 13, 11, 11, 17, 13, 15, 25, 17, 17, 29, 19, 23, 35, 25, 23, 39, 29, 29, 45, 33, 29, 55, 31, 35, 55, 39, 43, 65, 37, 43, 65, 51, 41, 77, 43, 51, 85, 53, 47, 85, 53, 65, 87, 61, 53, 99, 67, 67, 97, 67, 59, 119, 61, 71, 113, 75, 79, 123, 67, 79, 117
Offset: 0

Views

Author

Gus Wiseman, Apr 02 2021

Keywords

Examples

			The a(1) = 1 through a(9) = 13 compositions:
  (1)  (2)  (3)    (4)    (5)    (6)      (7)    (8)    (9)
            (1,2)  (1,3)  (1,4)  (1,5)    (1,6)  (1,7)  (1,8)
            (2,1)  (3,1)  (2,3)  (2,4)    (2,5)  (2,6)  (2,7)
                          (3,2)  (4,2)    (3,4)  (3,5)  (3,6)
                          (4,1)  (5,1)    (4,3)  (5,3)  (4,5)
                                 (1,2,3)  (5,2)  (6,2)  (5,4)
                                 (3,2,1)  (6,1)  (7,1)  (6,3)
                                                        (7,2)
                                                        (8,1)
                                                        (1,3,5)
                                                        (2,3,4)
                                                        (4,3,2)
                                                        (5,3,1)
		

Crossrefs

Strict compositions in general are counted by A032020.
The unordered version is A049980.
The non-strict version is A175342.
A000203 adds up divisors.
A000726 counts partitions with alternating parts unequal.
A003242 counts anti-run compositions.
A224958 counts compositions with alternating parts unequal.
A342343 counts compositions with alternating parts strictly decreasing.
A342495 counts compositions with constant quotients.
A342527 counts compositions with alternating parts equal.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@Select[IntegerPartitions[n],UnsameQ@@#&],SameQ@@Differences[#]&]],{n,0,30}]

Formula

a(n > 0) = A175342(n) - A000005(n) + 1.
a(n > 0) = 2*A049988(n) - 2*A000005(n) + 1 = 2*A049982(n) + 1.

A062969 Numbers k such that abs(d(k)-k-1) is prime, where d(k) is the number of divisors of k.

Original entry on oeis.org

3, 4, 6, 8, 9, 10, 12, 14, 18, 22, 24, 25, 26, 28, 30, 34, 46, 49, 52, 54, 62, 66, 72, 74, 76, 78, 80, 82, 84, 86, 90, 104, 106, 108, 110, 112, 114, 134, 138, 142, 150, 160, 166, 169, 170, 172, 174, 176, 180, 186, 192, 194, 202, 204, 208, 214, 226, 230, 234, 244, 246
Offset: 1

Views

Author

Jason Earls, Jul 23 2001

Keywords

Examples

			d(300)-300-1 = -283, absolute value of which is prime.
		

Crossrefs

Cf. A062968.

Programs

  • PARI
    j=[]; for(n=1,300, if(isprime(numdiv(n)-n-1),j=concat(j,n))); j

A366525 Irregular triangular array read by rows: T(n,k) = number of partitions p of n such that f(p) = k >= 0, where f is defined in Comments.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 3, 4, 3, 3, 6, 2, 6, 6, 3, 5, 9, 5, 3, 7, 9, 9, 4, 1, 7, 13, 12, 6, 4, 10, 12, 15, 12, 5, 2, 7, 16, 19, 16, 12, 5, 2, 12, 16, 24, 22, 18, 6, 3, 11, 20, 28, 29, 24, 14, 6, 3, 12, 19, 31, 34, 36, 24, 13, 4, 3, 12, 23, 36, 42, 50, 30, 25, 8, 4
Offset: 1

Views

Author

Clark Kimberling, Oct 12 2023

Keywords

Comments

For a partition p = (p(1),p(2),...,p(k)) of n, where p(1) >= p(2) >= ... >= p(k), define r(p) by subtracting 1 from p(1) and adding 1 to p(k) and then arranging the result in nonincreasing order. Iterating r eventually results in repetition; the function f(p) is the number of iterations of r up to but not including the first repeat. For example, starting with (5,3,2,2,1,1,1,1), the r-iterates are (4,3,2,2,2,1,1,1), (3,3,2,2,2,2,1,1), (3,2,2,2,2,2,2,1), (2,2,2,2,2,2,2,2), (3,2,2,2,2,2,2,1), so that f(5,3,2,2,1,1,1,1) = 3.

Examples

			First 18 rows:
   1
   1     1
   2     1
   2     3
   4     3
   3     6     2
   6     6     3
   5     9     5     3
   7     9     9     4     1
   7    13    12     6     4
  10    12    15    12     5     2
   7    16    19    16    12     5    2
  12    16    24    22    18     6    3
  11    20    28    29    24    14    6      3
  12    19    31    34    36    24    13     4     3
  12    23    36    42    50    30    25     8     4    1
  16    23    42    54    59    45    34    15     5    4
  13    28    47    57    74    61    52    28    16    5    4
Row 6 represents 3 partitions p that are self-repeating (i.e., k = 0), 6 such that f(p) = 1, and 2 such that f(p) = 2. Specifically,
  f(p) = 0 for these partitions: [6], [2,2,1,1], [2,1,1,1].
f(p) = 1 for these: [4,2], [3,3], [3,2,1], [3,1,1,1], [2,2,2], [1,1,1,1,1,1].
f(p) = 2 for these: [5,1], [4,1,1].
		

Crossrefs

Cf. A000041 (row sums), A003479 (row lengths, after 2nd term).
Cf. A062968 (1st column).

Programs

  • Mathematica
    r[list_] := If[Length[list] == 1, list, Reverse[Sort[# +
    Join[{-1}, ConstantArray[0, Length[#] - 2], {1}]] &[Reverse[Sort[list]]]]];
    f[list_] := NestWhileList[r, Reverse[Sort[list]], Unequal, All];
    t = Table[BinCounts[#, {0, Max[#] + 1, 1}] &[Map[-1 + Length[Union[#]] &[f[#]] &, IntegerPartitions[n]]], {n, 1,20}]
    Map[Length, t]; t1 = Take[t, 18]; TableForm[t1]
    Flatten[t1]
    (* Peter J. C. Moses, Oct 10 2023 *)
  • Python
    from sympy .utilities.iterables import ordered_partitions
    from collections import Counter
    def A366525_rowlist(row_n):
        A = []
        for i in range(1,row_n+1):
            A.append([]); p,C = list(ordered_partitions(i)),Counter()
            for j in range(0,len(p)):
                x,a1,a,b = 0,[],list(p[j]),list(p[j])
                while i:
                    b[-1] -= 1; b[0] += 1
                    if b[-1] == 0: b.pop(-1)
                    b = sorted(b); x += 1
                    if a == b or a1 == b:
                        C.update({x}); break
                    else:
                        a1 = a.copy(); a = b.copy()
            for z in range(1,len(C)+1): A[i-1].append(C[z])
        return(A) # John Tyler Rascoe, Nov 09 2023
Previous Showing 11-15 of 15 results.