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.

User: Jens Ahlström

Jens Ahlström's wiki page.

Jens Ahlström has authored 17 sequences. Here are the ten most recent ones:

A385707 Irregular triangle T(r,k) read by rows in which row r lists the partitions into distinct primes of the r-th number having such partitions, r >= 1, k >= 1.

Original entry on oeis.org

2, 3, 5, 3, 2, 7, 5, 2, 5, 3, 7, 2, 7, 3, 5, 3, 2, 11, 7, 5, 7, 3, 2, 13, 11, 2, 11, 3, 7, 5, 2, 13, 2, 7, 5, 3, 13, 3, 11, 5, 11, 3, 2, 17, 7, 5, 3, 2, 13, 5, 13, 3, 2, 11, 7, 11, 5, 2, 19, 17, 2, 11, 5, 3, 17, 3, 13, 7, 13, 5, 2, 11, 7, 2, 19, 2, 13, 5, 3
Offset: 2

Author

Jens Ahlström, Jul 07 2025

Keywords

Comments

A table of partitions of n into distinct prime parts in graded reverse lexicographic ordering.

Examples

			   r    n \ k  1    2    3    4    5
  -----------------------------------
   1    2    [ 2];
   2    3    [ 3];
   3    5    [ 5], [3,   2];
   4    7    [ 7], [5,   2];
   5    8    [ 5,   3];
   6    9    [ 7,   2];
   7   10    [ 7,   3], [5,   3,   2];
   8   11    [11];
   9   12    [ 7,   5], [7,   3,   2];
   ...
For n = 10 we can see that 10 is the 7th number having partitions into distinct primes so the 7th row of the triangle lists the two partitions that are the two ways to write 10 as a sum of distinct primes: 7 + 3 and 5 + 3 + 2.
		

Crossrefs

Programs

  • Python
    from sympy.utilities.iterables import partitions
    from sympy import isprime
    res = []
    for n in range(22):
        for p in partitions(n):
            for i, f in p.items():
                if not isprime(i) or f>1:
                    break
            else:
                res.extend(list(p.keys()))
    print(res)

A385644 Swap multiplication and exponentiation in the canonical prime factorization of n.

Original entry on oeis.org

2, 3, 4, 5, 8, 7, 6, 6, 32, 11, 64, 13, 128, 243, 8, 17, 64, 19, 1024, 2187, 2048, 23, 216, 10, 8192, 9, 16384, 29, 14134776518227074636666380005943348126619871175004951664972849610340958208, 31, 10, 177147, 131072, 78125, 4096, 37, 524288, 1594323, 7776, 41
Offset: 2

Author

Jens Ahlström, Jul 06 2025

Keywords

Comments

In the canonical prime factorization of n larger than one, swap multiplication and exponentiation and calculate the result.

Examples

			a(6) = a(2 * 3) = 2^3 = 8,
a(24) = a(2^3 * 3) = (2 * 3)^3 = 216,
a(30) = a(2 * 3 * 5) = 2^3^5 = 2^243.
		

Crossrefs

Programs

  • Mathematica
    f[{p_,e_}]:=p*e;a[n_]:=Module[{pp=f/@FactorInteger[n]},r=pp[[-1]];Do[r=pp[[Length[pp]-i]]^r,{i,1,Length[pp]-1}];r];Array[a,40,2] (* James C. McMahon, Jul 11 2025 *)
    A385644[n_] := Power @@ Times @@@ FactorInteger[n];
    Array[A385644, 40, 2] (* Paolo Xausa, Jul 14 2025 *)
  • Python
    from sympy import factorint
    from functools import reduce
    def rpow(a, b):
        return b**a
    def a(n):
        return reduce(rpow, [p*e for p, e in reversed(factorint(n).items())])
    print([a(n) for n in range(2, 42)])

A385345 Numbers without a prime factor with a digit larger than 1.

Original entry on oeis.org

1, 11, 101, 121, 1111, 1331, 10111, 10201, 12221, 14641, 101111, 111221, 112211, 134431, 161051, 1011001, 1021211, 1030301, 1100101, 1112221, 1223431, 1234321, 1478741, 1771561, 10010101, 10011101, 10100011, 10101101, 10110011, 10111001, 10212211, 11000111, 11100101, 11110111, 11111101
Offset: 1

Author

Jens Ahlström, Jun 26 2025

Keywords

Comments

Numbers where all the digits of the prime factors are either 1 or 0. Multiplicative closure of A020449.

Examples

			121 = 11 * 11 is in the sequence, since its only prime factor 11 does not have any digits larger than 1.
1001 = 7 * 13 * 11 is not in the sequence since 7 and 13 has digits larger than 1.
		

Crossrefs

Supersequence of A020449.
Cf. A385344.

Programs

  • Mathematica
    Select[Range[2*10^6],AllTrue[IntegerDigits/@First/@FactorInteger[#]//Flatten,#<2&]&] (* James C. McMahon, Jun 28 2025 *)
  • Python
    from sympy import primefactors
    def ok(n): return all(set(str(p)) <= set("01") for p in primefactors(n))
    print([k for k in range(1, 2*10**6) if ok(k)]) # Michael S. Branicky, Jun 26 2025

Formula

{k | all prime factors of k are in A020449}. - Michael S. Branicky, Jun 26 2025

A385344 Numbers where all the digits of all the prime factors are smaller than 3.

Original entry on oeis.org

1, 2, 4, 8, 11, 16, 22, 32, 44, 64, 88, 101, 121, 128, 176, 202, 211, 242, 256, 352, 404, 422, 484, 512, 704, 808, 844, 968, 1021, 1024, 1111, 1201, 1331, 1408, 1616, 1688, 1936, 2011, 2042, 2048, 2111, 2221, 2222, 2321, 2402, 2662, 2816, 3232, 3376, 3872, 4022, 4084, 4096, 4222, 4442, 4444, 4642, 4804, 5324, 5632
Offset: 1

Author

Jens Ahlström, Jun 26 2025

Keywords

Comments

Multiplicative closure of A036953.

Examples

			202 is in the sequence since the prime factors 2 and 101 both have all digits smaller than 3.
34 is not in the sequence since it has the prime factor 17 that have a digit larger than 2.
		

Crossrefs

Supersequence of A036953. Cf. A385345.

Programs

  • Mathematica
    A385344Q[k_] := AllTrue[FactorInteger[k][[All, 1]], Max[IntegerDigits[#]] < 3 &];
    Select[Range[10000], A385344Q] (* Paolo Xausa, Jun 28 2025 *)
  • Python
    from sympy import primefactors
    def ok(n): return all(set(str(f)) <= set("012") for f in primefactors(n))
    print([k for k in range(1, 6000) if ok(k)]) # Michael S. Branicky, Jun 26 2025

Formula

{k | all prime factors of k are in A036953}. - Michael S. Branicky, Jun 26 2025

A375605 Number of composite knots with n crossings.

Original entry on oeis.org

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

Author

Jens Ahlström, Aug 20 2024

Keywords

Comments

A knot is composite if and only if it can be written as the knot sum of two nontrivial knots.

Examples

			For n = 6 there are totally 5 knots out of which 3 are prime, so a(6) = 5 - 3 = 2.
		

Crossrefs

Formula

a(n) = A086825(n) - A002863(n), for all n > 0.

A370482 Characteristic function of primes plus characteristic function of even numbers.

Original entry on oeis.org

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

Author

Jens Ahlström, Mar 31 2024

Keywords

Comments

There is only one 2 in the sequence, so if the value 2 is blanked out, a riddle is created that demands some out-of-the-box thinking.

Examples

			1 is neither prime nor even so a(1) = 0 + 0 = 0.
2 is both a prime and even so a(2) = 1 + 1 = 2.
3 is a prime but odd so a(3) = 1 + 0 = 1.
4 is not a prime but even so a(4) = 0 + 1 = 1.
		

Crossrefs

If a(2) were 1 instead of 2, then this would the characteristic function of {0} U A106092, whose complement A014076 gives the positions of 0's. - Antti Karttunen, Jan 17 2025

Programs

  • Mathematica
    a[n_] := Boole[PrimeQ[n]] + Boole[EvenQ[n]]; Array[a, 100, 0] (* Amiram Eldar, Mar 31 2024 *)
  • PARI
    A370482(n) = (!(n%2) + isprime(n)); \\ Antti Karttunen, Jan 17 2025
  • Python
    from sympy import isprime
    def A370482(n): return isprime(n)+(n&1^1) # Chai Wah Wu, Apr 25 2024
    

Formula

a(n) = A010051(n) + A059841(n).

A359612 Largest prime factor with minimal exponent in canonical prime factorization of n.

Original entry on oeis.org

2, 3, 2, 5, 3, 7, 2, 3, 5, 11, 3, 13, 7, 5, 2, 17, 2, 19, 5, 7, 11, 23, 3, 5, 13, 3, 7, 29, 5, 31, 2, 11, 17, 7, 3, 37, 19, 13, 5, 41, 7, 43, 11, 5, 23, 47, 3, 7, 2, 17, 13, 53, 2, 11, 7, 19, 29, 59, 5, 61, 31, 7, 2, 13, 11, 67, 17, 23, 7, 71, 3, 73, 37, 3
Offset: 2

Author

Jens Ahlström, Jan 06 2023

Keywords

Comments

When inspecting the minimal exponent of the canonical representation of n, a(n) is the largest of those primes, while A067695(n) is the smallest.
On the other hand if the maximal exponent is regarded similarly, A356840(n) is the largest of those primes and A356838(n) is the smallest.
18 is the smallest n, where a(n) differs from A006530(n), since a(18) = 2, while A006530(18) = 3.

Examples

			a(162) = a(2^1 * 3^4) = 2.
a(225) = a(3^2 * 5^2) = 5.
		

Crossrefs

Programs

  • Maple
    a:= n-> (l-> (m-> max(map(i-> i[1], select(y->y[2]=m,
             l))))(min(map(x-> x[2], l))))(ifactors(n)[2]):
    seq(a(n), n=2..75);  # Alois P. Heinz, Jan 25 2023
  • Mathematica
    a[n_] := Module[{f = FactorInteger[n], e, ind}, e = f[[;; , 2]]; ind = Position[e, Min[e]][[-1, 1]]; f[[ind, 1]]]; Array[a, 100, 2] (* Amiram Eldar, Jan 07 2023 *)
  • PARI
    a(n) = my(f=factor(n), e=vecmin(f[,2])); f[vecmax(select(x->(x==e), f[,2], 1)), 1]; \\ Michel Marcus, Jan 26 2023
  • Python
    from sympy import factorint
    def a(n):
        max_factor = 0
        min_exponent = float("inf")
        for p, exponent in factorint(n).items():
            if exponent < min_exponent:
                max_factor = p
                min_exponent = exponent
            elif exponent == min_exponent:
                max_factor = max(max_factor, p)
        return max_factor
    
  • Python
    from sympy import factorint
    def A359612(n): return (f:=list(map(tuple,zip(*sorted(factorint(n).items(),reverse=True)))))[0][f[1].index(min(f[1]))] # Chai Wah Wu, Feb 07 2023
    

A359178 Numbers with a unique smallest prime exponent.

Original entry on oeis.org

2, 3, 4, 5, 7, 8, 9, 11, 12, 13, 16, 17, 18, 19, 20, 23, 24, 25, 27, 28, 29, 31, 32, 37, 40, 41, 43, 44, 45, 47, 48, 49, 50, 52, 53, 54, 56, 59, 61, 63, 64, 67, 68, 71, 72, 73, 75, 76, 79, 80, 81, 83, 88, 89, 92, 96, 97, 98, 99, 101, 103, 104, 107, 108, 109, 112, 113, 116, 117
Offset: 1

Author

Jens Ahlström, Jan 08 2023

Keywords

Comments

180 is the smallest number with a unique smallest prime exponent that is not a member of A130091.

Examples

			2 = 2^1 is a term since it has 1 as a unique smallest exponent.
6 = 2^1 * 3^1 is not a term since it has two primes with the same smallest exponent.
180 = 2^2 * 3^2 * 5^1 is a term since it has 1 as a unique smallest exponent.
		

Crossrefs

For parts instead of multiplicities we have A247180, counted by A002865.
For greatest instead of smallest we have A356862, counted by A362608.
The complement is A362606, counted by A362609.
Partitions of this type are counted by A362610.
These are the positions of 1's in A362613, for modes A362611.
A001221 counts prime exponents and A001222 adds them up.
A027746 lists prime factors, A112798 indices, A124010 exponents.

Programs

  • Mathematica
    q[n_] := Module[{e = FactorInteger[n][[;; , 2]]}, Count[e, Min[e]] == 1]; Select[Range[2, 200], q] (* Amiram Eldar, Jan 08 2023 *)
  • PARI
    isok(n) = if (n>1, my(f=factor(n), e = vecmin(f[,2])); #select(x->(x==e), f[,2], 1) == 1); \\ Michel Marcus, Jan 27 2023
  • Python
    from sympy import factorint
    def ok(k):
      c = sorted(factorint(k).values())
      return len(c) == 1 or c[0] != c[1]
    print([k for k in range(2, 118) if ok(k)])
    
  • Python
    from itertools import count, islice
    from sympy import factorint
    def A359178_gen(startvalue=2): # generator of terms >= startvalue
        return filter(lambda n:(f:=list(factorint(n).values())).count(min(f))==1,count(max(startvalue,2)))
    A359178_list = list(islice(A359178_gen(),20)) # Chai Wah Wu, Feb 08 2023
    

A356838 The smallest of the most common prime factors of n.

Original entry on oeis.org

2, 3, 2, 5, 2, 7, 2, 3, 2, 11, 2, 13, 2, 3, 2, 17, 3, 19, 2, 3, 2, 23, 2, 5, 2, 3, 2, 29, 2, 31, 2, 3, 2, 5, 2, 37, 2, 3, 2, 41, 2, 43, 2, 3, 2, 47, 2, 7, 5, 3, 2, 53, 3, 5, 2, 3, 2, 59, 2, 61, 2, 3, 2, 5, 2, 67, 2, 3, 2, 71, 2, 73, 2, 5, 2, 7, 2, 79, 2, 3, 2, 83, 2, 5, 2, 3, 2, 89
Offset: 2

Author

Jens Ahlström, Aug 31 2022

Keywords

Comments

Pick the prime factors of n with the largest exponent. a(n) is the smallest one of those prime factors.
If the prime factorization of n has a unique largest exponent (A356862), then a(n) = A356840(n). Otherwise a(n) is the smallest of the most common prime factors, while A356840(n) is the largest of them.
a(n) differs from A020639(n) in case the smallest prime factor is not the most common. For example: a(90) = 3, since 90 = 2 * 3^2 * 5 and 3 has the largest exponent. This is different from A020639(90) = 2, since 2 is the smallest prime factor.

Examples

			a(18) = 3, since 18 = 2 * 3^2 and 3 is the most common prime factor.
a(450) = 3, since 450 = 2 * 3^2 * 5^2 and 3 is the smallest of the most common prime factors.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{f = FactorInteger[n], p, e}, p = f[[;; , 1]]; e = f[[;; , 2]]; p[[FirstPosition[e, Max[e]][[1]]]]]; Array[a, 100, 2] (* Amiram Eldar, Sep 01 2022 *)
  • PARI
    a(n) = my(f=factor(n), m=vecmax(f[,2]), w=select(x->(f[x,2] == m), [1..#f~])); vecmin(vector(#w, k, f[w[k], 1])); \\ Michel Marcus, Sep 01 2022
  • Python
    from sympy import factorint
    from collections import Counter
    def a(n):
        return Counter(factorint(n)).most_common(1)[0][0]
    
  • Python
    from sympy import factorint
    def A356838(n): return max(factorint(n).items(),key=lambda x:(x[1],-x[0]))[0] # Chai Wah Wu, Sep 10 2022
    

A356840 Largest most common prime factor of n.

Original entry on oeis.org

2, 3, 2, 5, 3, 7, 2, 3, 5, 11, 2, 13, 7, 5, 2, 17, 3, 19, 2, 7, 11, 23, 2, 5, 13, 3, 2, 29, 5, 31, 2, 11, 17, 7, 3, 37, 19, 13, 2, 41, 7, 43, 2, 3, 23, 47, 2, 7, 5, 17, 2, 53, 3, 11, 2, 19, 29, 59, 2, 61, 31, 3, 2, 13, 11, 67, 2, 23, 7, 71, 2, 73, 37, 5, 2, 11, 13, 79, 2, 3, 41, 83
Offset: 2

Author

Jens Ahlström, Aug 31 2022

Keywords

Comments

Pick the prime factors of n with the largest exponent. a(n) is the largest one of those prime factors. If the prime factorization of n has a unique largest exponent, then a(n) = A356838(n). Otherwise, a(n) is the largest of those most common prime factors, while A356838(n) is the smallest of them.

Examples

			a(180) = 3, since 180 = 2^2 * 3^2 * 5 and the largest of the most common prime factor is 3.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{f = FactorInteger[n], p, e}, p = f[[;; , 1]]; e = f[[;; , 2]]; p[[Position[e, Max[e]][[-1,1]]]]]; Array[a, 100, 2] (* Amiram Eldar, Sep 01 2022 *)
  • PARI
    a(n) = my(f=factor(n), m=vecmax(f[,2]), w=select(x->(f[x,2] == m), [1..#f~])); vecmax(vector(#w, k, f[w[k], 1])); \\ Michel Marcus, Sep 01 2022
  • Python
    from sympy import factorint
    from collections import Counter
    def reversed_factors(n):
        return dict(reversed(list(factorint(n).items())))
    def a(n):
        return Counter(reversed_factors(n)).most_common(1)[0][0]
    
  • Python
    from sympy import factorint
    def A356840(n): return max(factorint(n).items(),key=lambda x:(x[1],x[0]))[0] # Chai Wah Wu, Sep 10 2022