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: , 0|1] = 0; A[n

, 0|1] = 0; A[n's wiki page.

, 0|1] = 0; A[n has authored 1321 sequences. Here are the ten most recent ones:

A387114 Number of divisors in common to all prime indices of n.

Original entry on oeis.org

0, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 1, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 2, 1, 4, 1, 2, 1, 1, 1, 1, 1, 6, 1, 2, 1, 2, 1, 4, 1, 1, 1, 4, 1, 3, 1, 1, 1, 5, 1, 1, 1, 2, 1, 2, 1, 6, 1, 2, 1, 2, 1, 2, 1, 1, 1, 6, 1, 4, 1, 1, 1, 1, 1, 4, 1, 2, 1, 2, 1, 1, 1, 2
Offset: 1

Author

Gus Wiseman, Aug 19 2025

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
Also the number of divisors of the greatest common divisor of the prime indices of n.

Examples

			The prime indices of 703 are {8,12}, with divisors {{1,2,4,8},{1,2,3,4,6,12}}, with {1,2,4} in common, so a(703) = 3.
		

Crossrefs

For initial interval instead of divisors we have A055396.
Positions of 1 are A289509, complement A318978.
Positions of 2 are A387119.
For prime factors or indices instead of divisors we have A387135, see A010055 or A069513.
A000005 counts divisors.
A001414 adds up distinct prime divisors, counted by A001221.
A003963 multiplies together the prime indices of n.
A112798 lists prime indices, row sums A056239 or A066328, lengths A001222.
A120383 lists numbers divisible by all of their prime indices.
A289508 gives greatest common divisor of prime indices.

Programs

  • Mathematica
    Table[If[n==1,0,Length[Divisors[GCD@@PrimePi/@First/@FactorInteger[n]]]],{n,100}]

Formula

a(1) = 0; a(n) = A000005(A289508(n)) for n > 1.

A386912 The base-2 logarithm of this sequence equals the Q statistic value of the greedy-from-the-bottom tree with n leaves, which is the minimal Q statistic value for n.

Original entry on oeis.org

1, 2, 6, 16, 60, 192, 672, 2048, 8640, 30720, 118272, 393216, 1597440, 5505024, 20643840, 67108864, 300810240, 1132462080, 4602200064, 16106127360, 68702699520, 248034361344, 972407439360, 3298534883328, 14495514624000, 53601191854080
Offset: 1

Author

Mareike Fischer, Aug 07 2025

Keywords

Examples

			a(1)=1, because a(1)=Product(i=2..1)=1 (empty product).
a(2)=2, because q(2,2)=1, so a(2)=2^q(2,2)=2^1=2.
a(3)=6, because q(3,2)=1 and q(3,3)=1, so a(3)=2^q(3,2)*3^q(3,3)=2^1*3^1=6.
		

Crossrefs

Cf. A132862.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<2, 1, (b-> (f->
          a(f)*n*a(n-f))(min(b, n-b/2)))(2^ilog2(n-1)))
        end:
    seq(a(n), n=1..26);  # Alois P. Heinz, Aug 18 2025
  • Mathematica
    q[n_, i_] := Module[{factor, ki}, factor = FactorInteger[i];
      ki = Ceiling[Log2[i]];
      If[(i == 1 || i == n), Return[n/i],
       If[(Length[factor] == 1 && factor[[1]][[1]] == 2),
         If[(Mod[n, i] == 0 || Mod[n, i] >= 2^(ki - 1)),
          Return[Floor[n/i]], Return[Floor[n/i] - 1]],
         If[Mod[n - i, 2^(ki - 1)] == 0, Return[1], Return[0]]];
       ]];
    a[n_] := Product[i^q[n, i], {i, 2, n}]; alist = {};
    For[n = 1, n <= 300, n++, AppendTo[alist, a[n]]]; Print[alist]
    (* Alternative, after Alois P. Heinz: *)
    A386912[n_] := A386912[n] = If[n == 1, 1, n*A386912[#]*A386912[n - #]] & [Min[#, n - #/2] & [2^(BitLength[n - 1] - 1)]]; Array[A386912, 30] (* Paolo Xausa, Aug 19 2025 *)
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def a(n: int) -> int:
        if n < 2: return 1
        b = 1 << ((n - 1).bit_length() - 1)
        f = min(b, n - b // 2)
        return a(f) * n * a(n - f)
    print([a(n) for n in range(1, 27)])  # after Alois P. Heinz, Peter Luschny, Aug 19 2025

Formula

a(n) = Product_{i=2..n} i^q(n,i), with k(i)=ceiling(log_2(i)) and q(n,i)=floor(n/i) if (i=2^(k(i)) and ((n mod i)=0 or (n mod i)>=2^(k(i)-1))), and q(n,i)=floor(n/i)-1 if (i=2^(k(i)) and (0 < (n mod i)< 2^(k(i)-1))) and q(n,i)=1 if (i!=2^(k(i)) and ( (n-i) mod 2^(k(i)-1)) =0 ) and q(n,i)=0 if (i!=2^(k(i)) and ( (n-i) mod 2^(k(i)-1)) >0 ).
a(n) = Product_{i=0..k(n)-1} (2^(k(n)-i))^(2^i) if d(n)=2^(k(n)-1). Else, a(n) = Product_{i=0..k(n)-2} (2^(k(n)-i-1))^(2^i) * 2^d(n) * Product_{i=1..k(n)-1} ( 2^floor(d(n)/(2^i)) * ((2^i + (d(n)-2^i*(floor(d(n)/(2^i))))) / (2^i) )^(ceiling(d(n)/2^i)-floor(d(n)/(2^i))) if d(n) < 2^(k(n)-1), with k(n)=ceiling(log_2(n)) and d(n)=n-2^(k(n)-1).
a(n) = n*a(f)*a(n-f) with f = min(b,n-b/2) and b = 2^floor(log_2(n-1)) for n>1, a(1) = 1. - Alois P. Heinz, Aug 18 2025

A386964 a(1) = prime(1) = 2, a(n) = 10*a(n-1) + (prime(n) mod 10).

Original entry on oeis.org

2, 23, 235, 2357, 23571, 235713, 2357137, 23571379, 235713793, 2357137939, 23571379391, 235713793917, 2357137939171, 23571379391713, 235713793917137, 2357137939171373, 23571379391713739, 235713793917137391, 2357137939171373917, 23571379391713739171, 235713793917137391713
Offset: 1

Author

Michael S. Branicky, Aug 11 2025

Keywords

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<1, 0, a(n-1)*10+irem(ithprime(n), 10)) end:
    seq(a(n), n=1..21);  # Alois P. Heinz, Aug 12 2025
  • Mathematica
    a[1]=2;a[n_]:=10a[n-1]+Mod[Prime[n],10];Array[a,21] (* James C. McMahon, Aug 12 2025 *)
  • Python
    from sympy import nextprime
    from itertools import islice
    def A386964(): # generator of terms
        an = pn = 2
        while True:
            yield an
            an = 10*an + (pn:=nextprime(pn))%10
    print(list(islice(A386964(), 21)))

Formula

a(n) = concatenation of A007652(1)..A007652(n).

A385254 Distinct terms in A386369.

Original entry on oeis.org

0, 1, 2, 6, 18, 26, 70, 82, 222, 642, 1902, 5682, 17022, 51042, 59778, 59958, 77774, 107258, 268870, 285010, 361086, 930666, 1084314, 1498134, 3813282, 5053994, 13240150, 14183598, 15487758, 15579122, 18418666, 18622506, 23809998, 58728474, 64572254, 65013058
Offset: 1

Author

David A. Corneth and Paolo Xausa, Jul 29 2025

Keywords

Comments

a(1) = 0. a(n) is the smallest positive integer > a(n-1) such that Sum_{m = 1..n-1} (a(m+1)-a(m))*a(m) is a perfect square.

Examples

			The first 6 terms of A386369 are 0, 1, 2, 2, 2, 2 which has partial sum 9. We have A386369(7) = 6. To find a(4) we look for the next term in A386369 that is larger than 6 i.e. solve 6*(k-6) + 9 = s^2 for some k. Rewrite gives 6*(k-6) = s^2 - 9 = (s-3)(s + 3). So we have 4 cases:
   1 | s - 3, 6 | s + 3
   2 | s - 3, 3 | s + 3
   3 | s - 3, 2 | s + 3
   6 | s - 3, 1 | s + 3
Solving for smallest t > 6 gives s = 9. So 6*(k-6) = 9^2 - 9 = 72 and so k = 18.
		

Crossrefs

Cf. A386369.

Programs

  • Mathematica
    Module[{s = 0, a = 0}, Table[If[IntegerQ[Sqrt[s += a]], a = k-1, Nothing], {k, 10^5}]]
  • PARI
    \\ See Corneth link

Extensions

More terms from Michael De Vlieger, Jul 29 2025

A385287 a(0) = 1, a(1) = 0; a(n) = a(n-2) + Sum_{k=0..n-1} k * a(k) * a(n-1-k).

Original entry on oeis.org

1, 0, 1, 2, 7, 32, 177, 1148, 8535, 71552, 668037, 6877742, 77448741, 947342072, 12512378625, 177525399952, 2693306735145, 43516930747192, 746123462304725, 13531269497675506, 258807528403312427, 5206929233591435496, 109929366336996502793, 2430108139669253103756
Offset: 0

Author

Seiichi Manyama, Jul 22 2025

Keywords

Crossrefs

Programs

  • PARI
    a_vector(n) = my(v=vector(n+1)); v[1]=1; for(i=2, n, v[i+1]=v[i-1]+sum(j=0, i-1, j*v[j+1]*v[i-j])); v;

Formula

G.f. A(x) satisfies A(x) = 1/( 1 - x^2 - x^2 * (d/dx A(x)) ).

A386262 a(n) = A051903(A051903(n)) for n >= 2, a(1) = 0.

Original entry on oeis.org

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

Author

Amiram Eldar, Jul 17 2025

Keywords

Comments

The first occurrence of k = 1, 2, ... is at n = 2^(2^k) = A001146(k).
If n is an exponentially squarefree number (A209061) then a(n) <= 1. The converse is not necessarily true, with n = 2592 = 2^5 * 3^4 being the least counterexample.
The asymptotic density of the occurrences of 0 in this sequence is 1/zeta(2) = 6/Pi^2 (A059956).
The asymptotic density of the occurrences of 1 in this sequence is Sum_{k squarefree > 1} (1/zeta(k+1) - 1/zeta(k)) = 0.348423339572619656701... .

Programs

  • Mathematica
    f[n_] := Max[FactorInteger[n][[;; , 2]]]; f[1] = 0; a[n_] := f[f[n]]; a[1] = 0; Array[a, 100]
  • PARI
    f(n) = if(n == 1, 0, vecmax(factor(n)[,2]));
    a(n) = if(n == 1, 0, f(f(n)));

Formula

a(n) = 0 if and only if n is squarefree (A005117).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Sum_{k>=2} A051903(k) * (1/zeta(k+1)-1/zeta(k)) = 0.43779421197744649258... .

A385542 The sum of the aliquot divisors of n that are powerful.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 5, 1, 1, 1, 13, 1, 10, 1, 5, 1, 1, 1, 13, 1, 1, 10, 5, 1, 1, 1, 29, 1, 1, 1, 14, 1, 1, 1, 13, 1, 1, 1, 5, 10, 1, 1, 29, 1, 26, 1, 5, 1, 37, 1, 13, 1, 1, 1, 5, 1, 1, 10, 61, 1, 1, 1, 5, 1, 1, 1, 58, 1, 1, 26, 5, 1, 1, 1, 29, 37
Offset: 1

Author

Amiram Eldar, Jul 03 2025

Keywords

Programs

  • Mathematica
    f[p_, e_] := (p^(e+1)-1)/(p-1) - p; a[1] = 0; a[n_] := Times @@ f @@@ (fct = FactorInteger[n]) - If[AllTrue[fct[[;;, 2]], # > 1 &], n, 0]; Array[a, 100]
  • PARI
    a(n) = {my(f = factor(n), s); s = prod(i=1, #f~, (f[i,1]^(f[i,2]+1)-1)/(f[i,1]-1) - f[i,1]); if(n==1 || vecmin(f[,2]) > 1, s -= n); s};

Formula

a(n) = Sum_{d|n, d < n} A112526(d) * d.
a(n) = A183097(n) - A112526(n) * n.
a(n) = 1 if and only if n is either a squarefree number (A005117) > 1 or a square of a prime (A001248), i.e., if and only if n is in A167207 \ {1}.
Dirichlet g.f.: (zeta(s) - 1)* zeta(2*s-2) * zeta(3*s-3) / zeta(6*s-6).
Sum_{k=1..n} a(k) ~ c * n^(3/2), where c = zeta(3/2)*(zeta(3/2)-1)/(3*zeta(3)) = 1.168033893310319119603... .
More precise asymptotics: Sum_{k=1..n} a(k) ~ (zeta(3/2) - 1)*zeta(3/2)*n^(3/2) / (3*zeta(3)) + 3*zeta(2/3)*(zeta(4/3) - 1)*n^(4/3) / (2*Pi^2) - n/2. - Vaclav Kotesovec, Jul 03 2025

A385378 The maximum possible number of distinct factors in the factorization of n into prime powers (A246655).

Original entry on oeis.org

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

Author

Amiram Eldar, Jun 27 2025

Keywords

Comments

Differs from A376885 and A384422 at n = 32, 64, 96, 128, 160, 192, ... .
Differs from A086435 at n = 36, 100, 144, 180, 196, 225, ... .
Differs from A375272 at n = 128, 384, 640, 896, 1024, 1152, ... .
a(n) depends only on the prime signature of n (A118914).
The indices of records in this sequence are the partial products of the sequence of powers of primes (A000961), i.e., the terms in A024923.
The least index n such that a(n) = k, for k = 0, 1, 2, ..., is A024923(k+1).

Examples

			      n | a(n) | factorization
  ------+------+--------------------------------
      2 |  1   | 2
      6 |  2   | 2 * 3
     24 |  3   | 2 * 3 * 2^2
    120 |  4   | 2 * 3 * 2^2 * 5
    840 |  5   | 2 * 3 * 2^2 * 5 * 7
   6720 |  6   | 2 * 3 * 2^2 * 5 * 7 * 2^3
  60480 |  7   | 2 * 3 * 2^2 * 5 * 7 * 2^3 * 3^2
		

Programs

  • Mathematica
    f[p_, e_] := Floor[(Sqrt[8*e + 1] - 1)/2]; a[1] = 0; a[n_] := Plus @@ f @@@ FactorInteger[n]; Array[a, 100]
  • PARI
    a(n) = vecsum(apply(x -> (sqrtint(8*x+1)-1)\2 , factor(n)[, 2]));

Formula

Additive with a(p^e) = A003056(e).
a(n) >= A001221(n), with equality if and only if n is cubefree (A004709).
a(n) >= 1 for n >= 2, with equality if and only if n is a prime or a square of a prime (A000430).
Sum_{k=1..n} a(k) ~ n * (log(log(n)) + B + C), where B is Mertens's constant (A077761), C = Sum_{k>=2} P(k*(k+1)/2) = 0.19285739770001405035..., and P is the prime zeta function.

A385379 The maximum possible number of distinct composite prime powers (A246547) in the factorization of n into prime powers.

Original entry on oeis.org

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

Author

Amiram Eldar, Jun 27 2025

Keywords

Comments

Differs from A376679 at n = 1, 48, 72, 80, ... .
The factorization includes primes if n is not a powerful number (A001694) that is larger than 1.
a(n) depends only on the prime signature of n (A118914).

Examples

			         n | a(n) | factorization
  ---------+------+----------------------------------------
         4 |  1   | 2^2
        32 |  2   | 2^2 * 2^3
       288 |  3   | 2^2 * 2^3 * 3^2
      4608 |  4   | 2^2 * 2^3 * 3^2 * 2^4
    115200 |  5   | 2^2 * 2^3 * 3^2 * 2^4 * 5^2
   3110400 |  6   | 2^2 * 2^3 * 3^2 * 2^4 * 5^2 * 3^3
  99532800 |  7   | 2^2 * 2^3 * 3^2 * 2^4 * 5^2 * 3^3 * 2^5
		

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := Floor[(Sqrt[8*e + 9] - 3)/2]; a[1] = 0; a[n_] := Plus @@ f @@@ FactorInteger[n]; Array[a, 100]
  • PARI
    a(n) = vecsum(apply(x -> (sqrtint(8*x+9)-1)\2 , factor(n)[, 2]));

Formula

Additive with a(p^e) = A052146(e+1).
a(n) = 0 if and only if n is squarefree (A005117).
a(A385380(n)) = n-1.
Sum_{k=1..n} a(k) ~ n * (log(log(n)) + B + C), where B is Mertens's constant (A077761), C = Sum_{k>=1} P(k*(k+3)/2) = 0.49006911093767425812..., and P is the prime zeta function.

A385196 The number of integers k from 1 to n such that the greatest divisor of k that is a unitary divisor of n is a prime number.

Original entry on oeis.org

0, 1, 1, 0, 1, 3, 1, 0, 0, 5, 1, 3, 1, 7, 6, 0, 1, 8, 1, 3, 8, 11, 1, 7, 0, 13, 0, 3, 1, 14, 1, 0, 12, 17, 10, 0, 1, 19, 14, 7, 1, 20, 1, 3, 8, 23, 1, 15, 0, 24, 18, 3, 1, 26, 14, 7, 20, 29, 1, 18, 1, 31, 8, 0, 16, 32, 1, 3, 24, 34, 1, 0, 1, 37, 24, 3, 16, 38
Offset: 1

Author

Amiram Eldar, Jun 21 2025

Keywords

Examples

			For n = 6, the greatest divisor of k that is a unitary divisor of 6 for k = 1 to 6 is 1, 2, 3, 2, 1 and 6, respectively. 3 of the values are primes, and therefore a(6) = 3.
		

Crossrefs

The unitary analog of A117494.
The number of integers k from 1 to n such that the greatest divisor of k that is a unitary divisor of n is: A047994 (1), A384048 (squarefree), A384049 (cubefree), A384050 (powerful), A384051 (cubefull), A384052 (square), A384053 (cube), A384054 (exponentially odd), A384055 (odd), A384056 (power of 2), A384057 (3-smooth), A384058 (5-rough), A385195 (1 or 2), this sequence (prime), A385197 (noncomposite), A385198 (prime power), A385199 (1 or prime power).

Programs

  • Mathematica
    f[p_, e_] := p^e - 1; a[1] = 0; a[n_] := Module[{fct = FactorInteger[n]}, (Times @@ f @@@ fct)*(Total[Boole[# == 1] & /@ fct[[;; , 2]]/(fct[[;; , 1]] - 1)])]; Array[a, 100]
  • PARI
    a(n) = {my(f = factor(n)); prod(i = 1, #f~, f[i,1]^f[i,2]-1) * sum(i = 1, #f~, (f[i,2] == 1)/(f[i,1] - 1));}
    
  • Python
    from sympy.ntheory import factorint
    from sympy import Rational
    def a(n: int) -> int:
        if n == 1: return 0
        S, P, F = 0, 1, factorint(n)
        for p, e in F.items():
            P *= p**e - 1
            if e == 1: S += Rational(1, p - 1)
        return int(P * S)
    print([a(n) for n in range(1, 79)])  # Peter Luschny, Jun 22 2025

Formula

The unitary convolution of A047994 (the unitary totient phi) with A010051 (the characteristic function of prime numbers): a(n) = Sum_{d | n, gcd(d, n/d) == 1} A047994(d) * A010051(n/d).
a(n) = uphi(n) * Sum_{p || n} (1/(p-1)), where uphi = A047994, and p || n denotes that p unitarily divides n (i.e., the p-adic valuation of n is 1).
a(n) = A385197(n) - A047994(n).
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = c1 * c2 = 0.21890744964919019488..., c1 = Product_{p prime}(1 - 1/(p*(p+1))) = A065463, and c2 = Sum_{p prime}((p^2-1)/(p^2*(p^2+p-1))) = 0.31075288978811405615... .