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

A078898 Number of times the smallest prime factor of n is the smallest prime factor for numbers <= n; a(0)=0, a(1)=1.

Original entry on oeis.org

0, 1, 1, 1, 2, 1, 3, 1, 4, 2, 5, 1, 6, 1, 7, 3, 8, 1, 9, 1, 10, 4, 11, 1, 12, 2, 13, 5, 14, 1, 15, 1, 16, 6, 17, 3, 18, 1, 19, 7, 20, 1, 21, 1, 22, 8, 23, 1, 24, 2, 25, 9, 26, 1, 27, 4, 28, 10, 29, 1, 30, 1, 31, 11, 32, 5, 33, 1, 34, 12, 35, 1, 36, 1, 37, 13, 38, 3, 39, 1, 40, 14, 41, 1, 42, 6, 43
Offset: 0

Views

Author

Reinhard Zumkeller, Dec 12 2002

Keywords

Comments

From Antti Karttunen, Dec 06 2014: (Start)
For n >= 2, a(n) tells in which column of the sieve of Eratosthenes (see A083140, A083221) n occurs in. A055396 gives the corresponding row index.
(End)

Crossrefs

Programs

  • Haskell
    import Data.IntMap (empty, findWithDefault, insert)
    a078898 n = a078898_list !! n
    a078898_list = 0 : 1 : f empty 2 where
       f m x = y : f (insert p y m) (x + 1) where
               y = findWithDefault 0 p m + 1
               p = a020639 x
    -- Reinhard Zumkeller, Apr 06 2015
  • Maple
    N:= 1000: # to get a(0) to a(N)
    Primes:= select(isprime, [2,seq(2*i+1,i=1..floor((N-1)/2))]):
    A:= Vector(N):
    for p in Primes do
      t:= 1:
      A[p]:= 1:
      for n from p^2 to N by p do
        if A[n] = 0 then
           t:= t+1:
           A[n]:= t
        fi
      od
    od:
    0,1,seq(A[i],i=2..N); # Robert Israel, Jan 04 2015
  • Mathematica
    Module[{nn=90,spfs},spfs=Table[FactorInteger[n][[1,1]],{n,nn}];Table[ Count[ Take[spfs,i],spfs[[i]]],{i,nn}]] (* Harvey P. Dale, Sep 01 2014 *)
  • PARI
    \\ Not practical for computing, but demonstrates the sum moebius formula:
    A020639(n) = { if(1==n,n,vecmin(factor(n)[, 1])); };
    A055396(n) = { if(1==n,0,primepi(A020639(n))); };
    A002110(n) = prod(i=1, n, prime(i));
    A078898(n) = { my(k,p); if(1==n, n, k = A002110(A055396(n)-1); p = A020639(n); sumdiv(k, d, moebius(d)*(n\(p*d)))); };
    \\ Antti Karttunen, Dec 05 2014
    
  • Scheme
    ;; With memoizing definec-macro.
    (definec (A078898 n) (if (< n 2) n (+ 1 (A078898 (A249744 n)))))
    ;; Much better for computing. Needs also code from A249738 and A249744. - Antti Karttunen, Dec 06 2014
    

Formula

Ordinal transform of A020639 (Lpf). - Franklin T. Adams-Watters, Aug 28 2006
From Antti Karttunen, Dec 05-08 2014: (Start)
a(0) = 0, a(1) = 1, a(n) = 1 + a(A249744(n)).
a(0) = 0, a(1) = 1, a(n) = sum_{d | A002110(A055396(n)-1)} moebius(d) * floor(n / (A020639(n)*d)).
a(0) = 0, a(1) = 1, a(n) = sum_{d | A002110(A055396(n)-1)} moebius(d) * floor(A032742(n) / d).
[Instead of Moebius mu (A008683) one could use Liouville's lambda (A008836) in the above formulas, because all primorials (A002110) are squarefree. A020639(n) gives the smallest prime dividing n, and A055396 gives its index].
a(0) = 0, a(1) = 1, a(2n) = n, a(2n+1) = a(A250470(2n+1)). [After a similar recursive formula for A246277. However, this cannot be used for computing the sequence, unless a definition for A250470(n) is found which doesn't require computing the value of A078898(n).]
For n > 1: a(n) = A249810(n) - A249820(n).
(End)
Other identities:
a(2*n) = n.
For n > 1: a(n)=1 if and only if n is prime.
For n > 1: a(n) = A249808(n, A055396(n)) = A249809(n, A055396(n)).
For n > 1: a(n) = A246277(A249818(n)).
From Antti Karttunen, Jan 04 2015: (Start)
a(n) = 2 if and only if n is a square of a prime.
For all n >= 1: a(A251728(n)) = A243055(A251728(n)) + 2. That is, if n is a semiprime of the form prime(i)*prime(j), prime(i) <= prime(j) < prime(i)^2, then a(n) = (j-i)+2.
(End)
a(A000040(n)^2) = 2; a(A000040(n)*A000040(n+1)) = 3. - Reinhard Zumkeller, Apr 06 2015
Sum_{k=1..n} a(k) ~ c * n^2 / 2, where c = Sum_{k>=1} (A038110(k)/A038111(k))^2 = 0.2847976823663... . - Amiram Eldar, Oct 26 2024

Extensions

a(0) = 0 prepended for recurrence's sake by Antti Karttunen, Dec 06 2014

A249727 Start with a(1) = 1; then numbers 1 .. primepi(2), followed by numbers 1 .. primepi(3), and then numbers 1 .. primepi(4), ..., etc, where A000720 gives primepi.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Nov 06 2014

Keywords

Comments

Can be used to construct the irregular table A249809.
This is a fractal sequence; i.e., the removal of the first occurrence of each term in A249727 leaves A249727, so that the sequence contains itself infinitely many times. The corresponding interspersion is A272616. - Clark Kimberling, May 12 2016

Crossrefs

Programs

A249728 After a(1) = 1 each n appears A000720(n) times.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Nov 06 2014

Keywords

Crossrefs

Programs

  • Mathematica
    Join[{1},Table[Table[n,PrimePi[n]],{n,20}]//Flatten] (* Harvey P. Dale, Nov 24 2018 *)

A249808 Triangular table read by rows, a lower right triangular region of square array A(n,k) is the number of times prime p_k has occurred as the smallest prime factor of numbers 1..n.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Nov 06 2014

Keywords

Comments

Table is read by taking n terms from the beginning of row n: A(1,1), A(2,1), A(2,2), A(3,1), A(3,2), A(3,3), ...
See also A249809 for a version with extra zeros removed.

Examples

			The first eleven rows of this triangular table:
  0;
  1, 0;
  1, 1, 0;
  2, 1, 0, 0;
  2, 1, 1, 0, 0;
  3, 1, 1, 0, 0, 0;
  3, 1, 1, 1, 0, 0, 0;
  4, 1, 1, 1, 0, 0, 0, 0;
  4, 2, 1, 1, 0, 0, 0, 0, 0;
  5, 2, 1, 1, 0, 0, 0, 0, 0, 0;
  5, 2, 1, 1, 1, 0, 0, 0, 0, 0, 0;
  ...
		

Crossrefs

A249809 is a more compact version.
A004526 gives the left edge, A001477 the row sums.

Programs

Formula

If row n = 1, A(n,k) = 0, otherwise A(n,k) = A(n-1,k) + [A055396(n) = k], where the subexpression with the Iverson bracket is 1 if the index of the smallest prime dividing n is equal to k, and 0 otherwise. This is a formula for a full square array containing mostly zeros. The terms of this sequence are those collected from the lower right triangle of that square array.
For n > 1, A078898(n) = A(n, A055396(n)).

A248809 Triangular array: row n gives the coefficients of the polynomial p(n,x) defined in Comments.

Original entry on oeis.org

1, 2, 1, 3, 2, 1, 8, 7, 2, 1, 15, 18, 12, 2, 1, 48, 57, 30, 18, 2, 1, 105, 174, 141, 44, 25, 2, 1, 384, 561, 414, 285, 60, 33, 2, 1, 945, 1950, 1830, 810, 510, 78, 42, 2, 1, 3840, 6555, 6090, 4680, 1410, 840, 98, 52, 2, 1, 10395, 25290, 26685, 15000, 10290
Offset: 0

Views

Author

Clark Kimberling, Oct 23 2014

Keywords

Comments

The polynomial p(n,x) is the numerator of the rational function given by f(n,x) = x + (n + 1)/f(n-1,x), where f(0,x) = 1.
(Sum of numbers in row n) = A000982(n+1) for n >= 0.
(Column 1) is essentially A006882 (double factorials).

Examples

			f(0,x) = 1/1, so that p(0,x) = 1.
f(1,x) = (2 + x)/1, so that p(1,x) = 2 + x.
f(2,x) = (3 + 2 x + x^2)/(2 + x), so that p(2,x) = 3 + 2 x + x^2.
First 6 rows of the triangle of coefficients:
1
2    1
3    2     1
8    7     2    1
15   18   12    2    1
48   57   30    18   2    1
		

Crossrefs

Programs

  • Mathematica
    z = 15; f[x_, n_] := x + (n + 1)/f[x, n - 1]; f[x_, 0] = 1;
    t = Table[Factor[f[x, n]], {n, 0, z}]
    u = Numerator[t]
    TableForm[Table[CoefficientList[u[[n]], x], {n, 1, z}]] (*A248809 array*)
    Flatten[CoefficientList[u, x]] (*A249809 sequence*)
  • PARI
    rown(n) = if (n==0, 1, x + (n+1)/rown(n-1));
    tabl(nn) = for (n=0, nn, print(Vecrev(numerator(rown(n))))); \\ Michel Marcus, Oct 25 2014
Showing 1-5 of 5 results.