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-10 of 13 results. Next

A331185 a(n) = n - prime(A067004(n)), where A067004 is the ordinal transform of number of divisors of n (A000005).

Original entry on oeis.org

-1, 0, 0, 2, 0, 4, 0, 5, 6, 5, 0, 10, 0, 7, 4, 14, 0, 15, 0, 15, 8, 5, 0, 22, 20, 7, 4, 21, 0, 27, 0, 21, 4, 3, -2, 34, 0, -3, -4, 35, 0, 35, 0, 31, 28, -1, 0, 46, 42, 31, -2, 29, 0, 43, -4, 43, -4, -9, 0, 58, 0, -9, 34, 62, -8, 49, 0, 37, -10, 51, 0, 69, 0, -9, 38, 35, -12, 55, 0, 77, 78, -15, 0, 79, -16, -17, -20, 59, 0, 83
Offset: 1

Views

Author

Antti Karttunen, Jan 12 2020

Keywords

Crossrefs

Cf. A000005, A000040 (positions of zeros), A067004, A331186, A331187.

Programs

  • Mathematica
    b[_] = 0;
    c[n_] := c[n] = With[{t = DivisorSigma[0, n]}, b[t] = b[t]+1];
    a[n_] := n - Prime[c[n]];
    Array[a, 105] (* Jean-François Alcover, Dec 20 2021 *)
  • PARI
    up_to = 65537;
    ordinal_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), pt); for(i=1, length(invec), if(mapisdefined(om,invec[i]), pt = mapget(om, invec[i]), pt = 0); outvec[i] = (1+pt); mapput(om,invec[i],(1+pt))); outvec; };
    v067004 = ordinal_transform(vector(up_to,n,numdiv(n)));
    A067004(n) = v067004[n];
    A331185(n) = (n - prime(A067004(n)));

Formula

a(n) = n - A000040(A067004(n)).

A331186 Exponent of the highest power of prime(A067004(n)) which divides n, where A067004 is the ordinal transform of number of divisors of n (A000005).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 12 2020

Keywords

Crossrefs

Programs

  • Mathematica
    b[_] = 0;
    A067004[n_] := A067004[n] = With[{t = DivisorSigma[0, n]}, b[t] = b[t]+1];
    a[n_] := IntegerExponent[n, Prime[A067004[n]]];
    Array[a, 105] (* Jean-François Alcover, Dec 21 2021 *)
  • PARI
    up_to = 65537;
    ordinal_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), pt); for(i=1, length(invec), if(mapisdefined(om,invec[i]), pt = mapget(om, invec[i]), pt = 0); outvec[i] = (1+pt); mapput(om,invec[i],(1+pt))); outvec; };
    v067004 = ordinal_transform(vector(up_to,n,numdiv(n)));
    A067004(n) = v067004[n];
    A331186(n) = valuation(n,prime(A067004(n)));

Formula

a(n) = A286561(n, A000040(A067004(n))), where A286561(n,k) gives the k-valuation of n.

A331187 a(n) is n divided by the highest power of prime(A067004(n)) which divides it, where A067004 is the ordinal transform of number of divisors of n (A000005).

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 1, 8, 1, 2, 1, 3, 1, 2, 15, 1, 1, 2, 1, 4, 21, 22, 1, 3, 1, 26, 27, 4, 1, 10, 1, 32, 33, 34, 35, 9, 1, 38, 39, 8, 1, 6, 1, 44, 45, 46, 1, 3, 1, 50, 51, 52, 1, 54, 55, 56, 57, 58, 1, 15, 1, 62, 63, 1, 65, 66, 1, 68, 69, 70, 1, 8, 1, 74, 75, 76, 77, 78, 1, 80, 1, 82, 1, 84, 85, 86, 87, 88, 1, 90
Offset: 1

Views

Author

Antti Karttunen, Jan 12 2020

Keywords

Crossrefs

Cf. also A331185.

Programs

  • Mathematica
    b[_] = 0;
    A067004[n_] := A067004[n] = With[{t = DivisorSigma[0, n]}, b[t] = b[t]+1];
    A331186[n_] := IntegerExponent[n, Prime[A067004[n]]];
    a[n_] := n/(Prime[A067004[n]]^A331186[n]);
    Array[a, 105] (* Jean-François Alcover, Dec 21 2021 *)
  • PARI
    up_to = 65537;
    ordinal_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), pt); for(i=1, length(invec), if(mapisdefined(om,invec[i]), pt = mapget(om, invec[i]), pt = 0); outvec[i] = (1+pt); mapput(om,invec[i],(1+pt))); outvec; };
    v067004 = ordinal_transform(vector(up_to,n,numdiv(n)));
    A067004(n) = v067004[n];
    A331187(n) = { my(p=prime(A067004(n))); n/(p^valuation(n,p)); };

Formula

a(n) = n / (A000040(A067004(n))^A331186(n)).

A081373 Number of values of k, 1 <= k <= n, with phi(k) = phi(n), where phi is Euler totient function, A000010.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Mar 24 2003

Keywords

Comments

Ordinal transform of Euler totient function phi, A000010. - Antti Karttunen, Aug 26 2024

Examples

			For n = 16: phi(k) = {1,1,2,2,4,2,6,4,6,4,10,4,12,6,8,8} for k = 1,...,n; 2 numbers exist with phi(k) = phi(n) = 8: {15,16}, so a(16) = 2.
If n = p is an odd prime number, then a(p) = 1 with phi(k) = p-1.
		

Crossrefs

Cf. A000010, A081375 (positions of records), A210719 (of 1's).
Cf. also A067004, A303756, A303757, A303777 (ordinal transform of this sequence).

Programs

  • Mathematica
    f[x_] := Count[Table[EulerPhi[j]-EulerPhi[x], {j, 1, x}], 0] Table[f[w], {w, 1, 100}]
  • PARI
    a(n)=my(t=eulerphi(n), s); sum(k=1, n, eulerphi(k)==t) \\ Charles R Greathouse IV, Feb 21 2013, corrected by Antti Karttunen, Aug 26 2024
    
  • PARI
    a(n) = #select(x -> x <= n, invphi(eulerphi(n))); \\ Amiram Eldar, Nov 08 2024, using Max Alekseyev's invphi.gp

A047983 Number of integers less than n but with the same number of divisors.

Original entry on oeis.org

0, 0, 1, 0, 2, 0, 3, 1, 1, 2, 4, 0, 5, 3, 4, 0, 6, 1, 7, 2, 5, 6, 8, 0, 2, 7, 8, 3, 9, 1, 10, 4, 9, 10, 11, 0, 11, 12, 13, 2, 12, 3, 13, 5, 6, 14, 14, 0, 3, 7, 15, 8, 15, 4, 16, 5, 17, 18, 16, 0, 17, 19, 9, 0, 20, 6, 18, 10, 21, 7, 19, 1, 20, 22, 11, 12, 23, 8, 21, 1, 1, 24, 22, 2, 25, 26, 27
Offset: 1

Views

Author

Simon Colton (simonco(AT)cs.york.ac.uk)

Keywords

Comments

Invented by the HR concept formation program.

Examples

			f(10) = 2 because tau(10) = 4 and also tau(6) = tau(8) = 4.
		

Crossrefs

Position of the 0's form A007416.

Programs

  • Haskell
    a047983 n = length [x | x <- [1..n-1], a000005 x == a000005 n]
    -- Reinhard Zumkeller, Nov 06 2011
    
  • Mathematica
    a[n_] := With[{tau = DivisorSigma[0, n]}, Length[ Select[ Range[n-1], DivisorSigma[0, #] == tau & ]]]; Table[a[n], {n, 1, 87}] (* Jean-François Alcover, Nov 30 2011 *)
    Module[{nn=90,ds},ds=DivisorSigma[0,Range[nn]];Table[Count[Take[ds,n], ds[[n]]]- 1,{n,nn}]] (* Harvey P. Dale, Feb 16 2014 *)
  • PARI
    A047983(n) = {local(d);d=numdiv(n);sum(k=1,n-1,(numdiv(k)==d))} \\ Michael B. Porter, Mar 01 2010
    
  • Python
    from sympy import divisor_count as D
    def a(n): return sum([1 for k in range(1, n) if D(k) == D(n)]) # Indranil Ghosh, Apr 30 2017

Formula

f(n) = |{k < n : tau(k) = tau(n)}|.
a(n) = A067004(n) - 1. - Amiram Eldar, Feb 04 2025

A067003 Number of numbers <= n with same number of distinct prime factors as n.

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Dec 21 2001

Keywords

Examples

			a(11)=8 since 2,3,4,5,7,8,9,11 each have one distinct prime factor. a(12)=3 since 6,10,12 each have two distinct prime factors.
From _Gus Wiseman_, Dec 28 2018: (Start)
Column n lists the a(n) positive integers less than or equal to n with the same number of distinct prime factors as n:
  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20
  ---------------------------------------------------------------------
  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20
        2  3  4     5  7  8  6   9   10  11  12  14  13  16  15  17  18
           2  3     4  5  7      8   6   9   10  12  11  13  14  16  15
              2     3  4  5      7       8   6   10  9   11  12  13  14
                    2  3  4      5       7       6   8   9   10  11  12
                       2  3      4       5           7   8   6   9   10
                          2      3       4           5   7       8   6
                                 2       3           4   5       7
                                         2           3   4       5
                                                     2   3       4
                                                         2       3
                                                                 2
(End)
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Range[n],PrimeNu[#]==PrimeNu[n]&]],{n,100}] (* Gus Wiseman, Dec 28 2018 *)
  • PARI
    a(n) = my(nb = #factor(n)~); sum(k=1, n, #factor(k)~ == nb); \\ Michel Marcus, Jul 13 2019

Formula

a(A002110(n)) = 1.

A335097 Number of integers less than n with the same number of prime factors (counted with multiplicity) as n.

Original entry on oeis.org

0, 0, 1, 0, 2, 1, 3, 0, 2, 3, 4, 1, 5, 4, 5, 0, 6, 2, 7, 3, 6, 7, 8, 1, 8, 9, 4, 5, 9, 6, 10, 0, 10, 11, 12, 2, 11, 13, 14, 3, 12, 7, 13, 8, 9, 15, 14, 1, 16, 10, 17, 11, 15, 4, 18, 5, 19, 20, 16, 6, 17, 21, 12, 0, 22, 13, 18, 14, 23, 15, 19, 2, 20, 24, 16, 17, 25, 18, 21, 3
Offset: 1

Views

Author

Ilya Gutkovskiy, Oct 31 2020

Keywords

Examples

			a(10) = 3 because bigomega(10) = 2 and also bigomega(4) = bigomega(6) = bigomega(9) = 2.
		

Crossrefs

Cf. A000079 (positions of 0's), A001222, A047983, A058933, A067004, A322838, A334655.

Programs

  • Maple
    A:= NULL:
    for n from 1 to 100 do
      t:= numtheory:-bigomega(n);
      if not assigned(R[t]) then
        A:= A,0;
        R[t]:= 1;
       else
        A:= A, R[t];
        R[t]:= R[t]+1;
       fi
    od:
    A; # Robert Israel, Oct 24 2021
  • Mathematica
    Table[Length[Select[Range[n - 1], PrimeOmega[#] == PrimeOmega[n] &]], {n, 80}]
  • PARI
    a(n)={my(t=bigomega(n)); sum(k=1, n-1, bigomega(k)==t)} \\ Andrew Howroyd, Oct 31 2020
    
  • Python
    from math import prod, isqrt
    from sympy import isprime, primepi, primerange, integer_nthroot, primeomega
    def A335097(n):
        if n==1: return 0
        if isprime(n): return primepi(n)-1
        def g(x,a,b,c,m): yield from (((d,) for d in enumerate(primerange(b,isqrt(x//c)+1),a)) if m==2 else (((a2,b2),)+d for a2,b2 in enumerate(primerange(b,integer_nthroot(x//c,m)[0]+1),a) for d in g(x,a2,b2,c*b2,m-1)))
        return int(sum(primepi(n//prod(c[1] for c in a))-a[-1][0] for a in g(n,0,1,1,primeomega(n)))-1) # Chai Wah Wu, Aug 28 2024

Formula

a(n) = |{j < n : bigomega(j) = bigomega(n)}|.
a(n) = A058933(n) - 1.

A081375 a(n) is the least number k such that A081373(k) = n.

Original entry on oeis.org

1, 2, 6, 12, 30, 42, 72, 78, 84, 90, 190, 216, 222, 228, 234, 252, 270, 540, 546, 570, 630, 738, 744, 770, 792, 858, 900, 924, 930, 990, 1050, 1638, 1710, 1890, 1980, 2100, 2310, 2418, 2442, 2508, 2562, 2574, 2604, 2700, 2772, 2790, 2850, 2970, 3150
Offset: 1

Views

Author

Labos Elemer, Mar 24 2003

Keywords

Crossrefs

Programs

  • Mathematica
    f[x_] := Count[Table[EulerPhi[j]-EulerPhi[x], {j, 1, x}], 0] t=Table[0, {50}]; Do[s=f[n]; If[s<51&&t[[s]]==0, t[[s]]=n], {n, 1, 4000}]; t
  • PARI
    lista(len) = {my(v = vector(len), c = 0, k = 1, i); while(c < len, i = #select(x -> x <= k, invphi(eulerphi(k))); if(i <= len && v[i] == 0, c++; v[i] = k); k++); v;} \\ Amiram Eldar, Nov 08 2024, using Max Alekseyev's invphi.gp

A334655 Number of integers less than n with the same number of distinct prime factors as n.

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Oct 31 2020

Keywords

Examples

			a(12) = 2 because omega(12) = 2 and also omega(6) = omega(10) = 2.
		

Crossrefs

Cf. A001221, A002110 (positions of 0's), A047983, A067003, A067004, A322837, A322841, A335097.

Programs

  • Maple
    R:= NULL:
    for n from 1 to 100 do
      w:= nops(numtheory:-factorset(n));
      if assigned(V[w]) then V[w]:= V[w]+1 else V[w]:= 1 fi;
      R:= R, V[w]-1
    od:
    R; # Robert Israel, Feb 25 2024
  • Mathematica
    Table[Length[Select[Range[n - 1], PrimeNu[#] == PrimeNu[n] &]], {n, 80}]
  • PARI
    a(n)={my(t=omega(n)); sum(k=1, n-1, omega(k)==t)} \\ Andrew Howroyd, Oct 31 2020

Formula

a(n) = |{j < n : omega(j) = omega(n)}|.
a(n) = A067003(n) - 1.

A138009 a(n) = number of positive integers k, k <= n, where d(k) >= d(n); d(n) = number of positive divisors of n.

Original entry on oeis.org

1, 1, 2, 1, 4, 1, 6, 2, 4, 3, 10, 1, 12, 5, 6, 2, 16, 2, 18, 3, 10, 11, 22, 1, 15, 13, 14, 5, 28, 2, 30, 7, 18, 19, 20, 1, 36, 22, 23, 4, 40, 5, 42, 11, 12, 28, 46, 1, 33, 14, 31, 15, 52, 7, 34, 8, 36, 37, 58, 1, 60, 39, 19, 10, 42, 10, 66, 22, 45, 11, 70, 2, 72, 48, 25, 26, 51, 13, 78, 4
Offset: 1

Views

Author

Leroy Quet, Feb 27 2008

Keywords

Examples

			9 has 3 positive divisors. Among the first 9 positive integers, there are four that have more than or equal the number of divisors than 9 has: 4, with 3 divisors; 6, with 4 divisors; 8, with 4 divisors; and 9, with 3 divisors. So a(9) = 4.
		

Crossrefs

Programs

  • Maple
    L:= [2]: A[1]:= 1:
    for n from 2 to 100 do
      v:= 2*numtheory:-tau(n);
      k:= ListTools:-BinaryPlace(L,v-1);
      A[n]:= n-k;
      L:= [op(L[1..k]),v,op(L[k+1..-1])];
    od:
    seq(A[i],i=1..100); # Robert Israel, Sep 26 2018
  • Mathematica
    Table[Length[Select[Range[n], Length[Divisors[ # ]]>=Length[Divisors[n]]&]], {n,1,100}] (* Stefan Steinerberger, Feb 29 2008 *)
  • PARI
    a(n) = my(dn=numdiv(n)); sum(k=1, n, numdiv(k) >= dn); \\ Michel Marcus, Sep 26 2018

Formula

From Amiram Eldar, Jun 26 2025: (Start)
a(n) = n - 1 if and only if n is prime.
a(n) = 1 if and only if n is a highly composite number (A002182). (End)

Extensions

More terms from Stefan Steinerberger, Feb 29 2008
Showing 1-10 of 13 results. Next