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

A078651 Number of increasing geometric-progression subsequences of [1,...,n] with integral successive-term ratio and length >= 1.

Original entry on oeis.org

1, 3, 5, 9, 11, 15, 17, 23, 27, 31, 33, 40, 42, 46, 50, 59, 61, 68, 70, 77, 81, 85, 87, 97, 101, 105, 111, 118, 120, 128, 130, 141, 145, 149, 153, 165, 167, 171, 175, 185, 187, 195, 197, 204, 211, 215, 217, 231, 235, 242, 246, 253, 255, 265, 269, 279, 283, 287
Offset: 1

Views

Author

Robert E. Sawyer (rs.1(AT)mindspring.com), Jan 08 2003

Keywords

Comments

The number of geometric-progression subsequences of [1,...,n] with integral successive-term ratio r and length k is floor(n/r^(k-1))(n > 0, r > 1, k > 0).

Examples

			a(1): [1]; a(2): [1],[2],[1,2]; a(3): [1],[2],[3],[1,2],[1,3].
		

Crossrefs

a(n) = n + A078632(n).
See A366471 for rational ratios.
See A078567 for APs.
Partial sums of A169594.

Programs

  • Maple
    g := (n, b) -> local i; add(iquo(n, b^i), i = 1..floor(log(n, b))):
    a := n -> local b; n + add(g(n, b), b = 2..n):
    seq(a(n), n = 1..58);  # Peter Luschny, Apr 03 2025
  • Mathematica
    Accumulate[1 + Table[Total[IntegerExponent[n, Rest[Divisors[n]]]], {n, 100}]] (* Paolo Xausa, Aug 27 2025 *)
  • PARI
    A078651(n) = {my(s=0, k=2); while(k<=n, s+=(n - sumdigits(n, k))/(k-1); k=k+1); n + s} \\ Zhuorui He, Aug 28 2025

Formula

a(n) = n + Sum_{r > 1, j > 0} floor(n/r^j).

A309891 a(n) is the total number of trailing zeros in the representations of n over all bases b >= 2.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Aug 21 2019

Keywords

Comments

a(n) depends only on the prime signature of n.
a(n) is the sum of the k-adic valuations of n for k >= 2. - Friedjof Tellkamp, Jan 25 2025

Examples

			For n = 12: 12 has 2 trailing zeros in base 2 (1100), 1 trailing zero in bases 3, 4, 6 and 12 (110, 30, 20, 10) and no trailing zero in other bases, hence a(12) = 1*2 + 4*1 = 6.
		

Crossrefs

Programs

  • Mathematica
    Table[DivisorSum[n, IntegerExponent[n, #] &, # > 1 &], {n, 84}] (* Jon Maiga, Aug 25 2019 *)
  • PARI
    a(n) = sumdiv(n, d, if (d>1, valuation(n,d), 0))
    
  • PARI
    a(n) = {if(n == 1, return(0)); my(f = factor(n)[, 2], res = 0, t = 2, of = f, nf = f >> 1, nd(v) = prod(i = 1, #v, v[i] + 1)); while(Set(of) != [0], res += (nd(of) - nd(nf)) * (t-1); of = nf; t++; nf = f \ t); res} \\ David A. Corneth, Aug 22 2019

Formula

a(n) = Sum_{d|n, d>1} A286561(n,d), where A286561 gives the d-valuation of n.
a(p) = 1 for any prime number p.
a(p^k) = A006218(k) for any k >= 0 and any prime number p.
a(n) = 2^A001221(n) - 1 for any squarefree number n.
a(n) = 3 for any semiprime number n.
a(m*n) >= a(m) + a(n).
a(n) >= A007814(n) + A007949(n) + A235127(n) + A112765(n) + A122841(n) + A214411(n) + A244413(n).
a(n) = A056239(A293514(n)). - Antti Karttunen, Aug 22 2019
a(n) <= A033093(n). - Michel Marcus, Aug 22 2019
a(n) = A169594(n) - 1. - Jon Maiga, Aug 25 2019
From Friedjof Tellkamp, Feb 27 2024: (Start)
G.f.: Sum_{k>=2, j>=1} x^(k^j)/(1-x^(k^j)).
Dirichlet g.f.: zeta(s) * Sum_{k>=1} (zeta(k*s) - 1).
Sum_{n>=1} a(n)/n^2 = Pi^2/8 (A111003). (End)

A090623 Triangle of T(n,k) = [n/k] + [n/k^2] + [n/k^3] + [n/k^4] + ... for n, k > 1.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Dec 06 2003

Keywords

Examples

			Rows start:
  1;
  1,1;
  3,1,1;
  3,1,1,1;
  4,2,1,1,1;
  4,2,1,1,1,1;
  7,2,2,1,1,1,1;
  7,4,2,1,1,1,1,1;
  8,4,2,2,1,1,1,1,1;
  ...
		

Crossrefs

Programs

  • Mathematica
    A090623[n_, k_] := Quotient[n - DigitSum[n, k], k - 1];
    Table[A090623[n, k], {n, 2, 15}, {k, 2, n}] (* Paolo Xausa, Sep 02 2025 *)
  • PARI
    T(n,k) = {my(s = 0, j = 1); while(p=n\k^j, s += p; j++); s;} \\ Michel Marcus, Feb 02 2016
    
  • PARI
    T(n,k) = (n - sumdigits(n,k))/(k-1) \\ Zhuorui He, Aug 25 2025

Formula

For p prime, T(n, p) = A090622(n, p) is the number of times that p is a factor of n!.
T(n,k) = (n - A240236(n, k))/(k - 1). - Zhuorui He, Aug 25 2025

Extensions

a(41) onward corrected by Zhuorui He, Aug 25 2025

A381886 Triangle read by rows: T(n, k) = Sum_{j=1..floor(log[k](n))} floor(n / k^j) if k >= 2, T(n, 1) = n, T(n, 0) = 0^n.

Original entry on oeis.org

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

Views

Author

Peter Luschny, Apr 03 2025

Keywords

Examples

			Triangle starts:
  [ 0] 1;
  [ 1] 0,  1;
  [ 2] 0,  2,  1;
  [ 3] 0,  3,  1, 1;
  [ 4] 0,  4,  3, 1, 1;
  [ 5] 0,  5,  3, 1, 1, 1;
  [ 6] 0,  6,  4, 2, 1, 1, 1;
  [ 7] 0,  7,  4, 2, 1, 1, 1, 1;
  [ 8] 0,  8,  7, 2, 2, 1, 1, 1, 1;
  [ 9] 0,  9,  7, 4, 2, 1, 1, 1, 1, 1;
  [10] 0, 10,  8, 4, 2, 2, 1, 1, 1, 1, 1;
  [11] 0, 11,  8, 4, 2, 2, 1, 1, 1, 1, 1, 1;
  [12] 0, 12, 10, 5, 3, 2, 2, 1, 1, 1, 1, 1, 1;
		

Crossrefs

Cf. A011371 (column 2), A054861 (column 3), A054893 (column 4), A027868 (column 5), A054895 (column 6), A054896 (column 7), A054897 (column 8), A054898 (column 9), A078651 (row sums).

Programs

  • Maple
    T := (n, b) -> local i; ifelse(b = 0, b^n, ifelse(b = 1, n, add(iquo(n, b^i), i = 1..floor(log(n, b))))): seq(seq(T(n, b), b = 0..n), n = 0..12);
    # Alternative:
    T := (n, k) -> local j; ifelse(k = 0, k^n, ifelse(k = 1, n, add(padic:-ordp(j, k), j = 1..n))): for n from 0 to 12 do seq(T(n, k), k = 0..n) od;
  • Mathematica
    T[n_, 0] := If[n == 0, 1, 0]; T[n_, 1] := n;
    T[n_, k_] := Last@Accumulate[IntegerExponent[Range[n], k]];
    Table[T[n, k], {n, 0, 12}, {k, 0, n}] // MatrixForm
    (* Alternative: *)
    T[n_, k_] := Sum[Floor[n/k^j], {j, Floor[Log[k, n]]}]; T[n_, 1] := n; T[n_, 0] := 0^n; T[0, 0] = 1; Flatten@ Table[T[n, k], {n, 0, 12}, {k, 0, n}] (* Michael De Vlieger, Apr 03 2025 *)
  • PARI
    T(n,k) = if (n==0, 1, if (n==1, k, if (k==0, 0, if (k==1, n, sum(j=1, n, valuation(j, k))))));
    row(n) = vector(n+1, k, T(n,k-1)); \\ Michel Marcus, Apr 04 2025
  • Python
    from math import log
    def T(n: int, b: int) -> int:
        return (b**n if b == 0 else n if b == 1 else
            sum(n // (b**i) for i in range(1, 1 + int(log(n, b)))))
    print([[T(n, b) for b in range(n+1)] for n in range(12)])
    
  • SageMath
    def T(n, b): return (b^n if b == 0 else n if b == 1 else sum(valuation(j, b) for j in (1..n)))
    print(flatten([[T(n, b) for b in range(n+1)] for n in srange(13)]))
    

Formula

T(n, k) = Sum_{j=1..n} valuation(j, k) for n >= 2.
Showing 1-4 of 4 results.