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.

Previous Showing 11-20 of 25 results. Next

A305976 Filter sequence for a(prime^k) = constant sequences.

Original entry on oeis.org

1, 2, 2, 2, 2, 3, 2, 2, 2, 4, 2, 5, 2, 6, 7, 2, 2, 8, 2, 9, 10, 11, 2, 12, 2, 13, 2, 14, 2, 15, 2, 2, 16, 17, 18, 19, 2, 20, 21, 22, 2, 23, 2, 24, 25, 26, 2, 27, 2, 28, 29, 30, 2, 31, 32, 33, 34, 35, 2, 36, 2, 37, 38, 2, 39, 40, 2, 41, 42, 43, 2, 44, 2, 45, 46, 47, 48, 49, 2, 50, 2, 51, 2, 52, 53, 54, 55, 56, 2, 57, 58, 59, 60, 61, 62, 63, 2, 64, 65, 66, 2
Offset: 1

Views

Author

Antti Karttunen, Jul 02 2018

Keywords

Crossrefs

Programs

  • PARI
    up_to = 100000;
    partialsums(f,up_to) = { my(v = vector(up_to), s=0); for(i=1,up_to,s += f(i); v[i] = s); (v); }
    v065515 = partialsums(n -> (omega(n)<=1), up_to);
    A065515(n) = v065515[n];
    A085970(n) = (n - A065515(n));
    A305976(n) = if(1==n,n,if(isprimepower(n),2,2+A085970(n)));

Formula

a(1) = 1, for n > 1, if A010055(n) = 1 [when n is in A246655], a(n) = 2, otherwise a(n) = 2+A085970(n) = running count from 3 onward.

A024620 Positions of primes among the powers of primes (A000961).

Original entry on oeis.org

2, 3, 5, 6, 9, 10, 12, 13, 14, 17, 18, 20, 21, 22, 23, 25, 26, 27, 29, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 44, 46, 47, 48, 49, 50, 51, 52, 53, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 70, 72, 73, 74, 75, 76, 77, 78, 80, 81, 82, 83, 84, 85, 86, 88, 89, 90, 91, 93, 94
Offset: 1

Views

Author

Keywords

Crossrefs

Complement of A024621.
Cf. A001222 (bigomega), A025474, A056604, A027883.

Programs

  • Haskell
    a024620 n = a024620_list !! (n-1)
    a024620_list = filter ((== 1) . a025474) [1..]
    -- Reinhard Zumkeller, May 01 2015
    
  • Mathematica
    a[n_] := PrimeOmega[LCM @@ Range@Prime@n] + 1; Array[a, 100] (* Amiram Eldar, Dec 02 2018 *)
  • PARI
    lista(nn) = my(powpr = select((i->((omega(i)==1) || (i==1))), [1..nn])); for (i = 1, #powpr, if (isprime(powpr[i]), print1(i, ", ")); ); \\ Michel Marcus, Jun 03 2021
    
  • Python
    from sympy import prime, primepi, integer_nthroot
    def A024620(n):
        x = prime(n)
        return n+1+sum(primepi(integer_nthroot(x,k)[0]) for k in range(2,x.bit_length())) # Chai Wah Wu, Nov 05 2024

Formula

A025474(a(n)) = 1. - Reinhard Zumkeller, May 01 2015
a(n) = A001222(A056604(n)) + 1. - Eric Desbiaux, Dec 02 2018
From Ridouane Oudra, Oct 18 2020: (Start)
a(n) = A027883(n) + 1;
a(n) = A025528(A000040(n)) + 1;
a(n) = A065515(A000040(n)). (End)

A085501 Number of prime powers p^k <= n that are not prime (k = 0 or k > 1).

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jul 03 2003

Keywords

Comments

a(n) = Max{k: A025475(k)<=n};
a(n)=A065515(n)-A000720(n)=A069637(n)+1;
for n<36=(2*3)^2: a(n) = A069623(n).

Programs

  • PARI
    a(n)=sum(k=2,logint(n,2), primepi(sqrtnint(n,k)))+1 \\ Charles R Greathouse IV, Jul 21 2017
    
  • PARI
    first(n)=my(v=vector(n),s=1); for(e=2,logint(n,2), forprime(p=2,sqrtnint(n,e), v[p^e]=1)); for(i=1,n, s+=v[i]; v[i]=s); v \\ Charles R Greathouse IV, Jul 21 2017
    
  • Python
    from sympy import primepi, integer_nthroot
    def A085501(n): return 1+sum(primepi(integer_nthroot(n,k)[0]) for k in range(2,n.bit_length())) # Chai Wah Wu, Aug 15 2024

A305975 Filter sequence: All prime powers p^k, k >= 1, are allotted to distinct equivalence classes according to their exponent k, while all other numbers occur in singular equivalence classes of their own.

Original entry on oeis.org

1, 2, 2, 3, 2, 4, 2, 5, 3, 6, 2, 7, 2, 8, 9, 10, 2, 11, 2, 12, 13, 14, 2, 15, 3, 16, 5, 17, 2, 18, 2, 19, 20, 21, 22, 23, 2, 24, 25, 26, 2, 27, 2, 28, 29, 30, 2, 31, 3, 32, 33, 34, 2, 35, 36, 37, 38, 39, 2, 40, 2, 41, 42, 43, 44, 45, 2, 46, 47, 48, 2, 49, 2, 50, 51, 52, 53, 54, 2, 55, 10, 56, 2, 57, 58, 59, 60, 61, 2, 62, 63, 64, 65, 66, 67, 68, 2, 69, 70, 71
Offset: 1

Views

Author

Antti Karttunen, Jul 02 2018

Keywords

Comments

Restricted growth sequence transform of A305974.
For all i, j: A305800(i) = A305800(j) => a(i) = a(j) => A305976(i) = A305976(j).

Crossrefs

Programs

  • PARI
    up_to = 100000;
    partialsums(f,up_to) = { my(v = vector(up_to), s=0); for(i=1,up_to,s += f(i); v[i] = s); (v); }
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    v065515 = partialsums(n -> (omega(n)<=1), up_to);
    A065515(n) = v065515[n];
    A085970(n) = (n - A065515(n));
    A305974(n) = if(1==n,n,my(e = isprimepower(n)); if(e,-e,1+A085970(n)));
    v305975 = rgs_transform(vector(up_to,n,A305974(n)));
    A305975(n) = v305975[n];

Formula

a(prime) = 2, a(prime^2) = 3, a(prime^3) = 5, a(prime^4) = 10, a(prime^5) = 19.

A085972 Number of numbers <= n that are primes or not prime powers.

Original entry on oeis.org

0, 1, 2, 2, 3, 4, 5, 5, 5, 6, 7, 8, 9, 10, 11, 11, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 20, 21, 22, 23, 24, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 54, 55, 56, 57, 58, 59, 60, 61
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 06 2003

Keywords

Comments

a(n) = Max{k: A085971(k)<=n};
a(n) = n-A085501(n) = A000720(n)+n-A065515(n) = A085970(n)+A000720(n).

Programs

  • Mathematica
    Accumulate[Table[If[PrimeQ[n]||(!PrimePowerQ[n]),1,0],{n,80}]]-1 (* Harvey P. Dale, Oct 13 2022 *)
  • Python
    from sympy import primepi, integer_nthroot
    def A085972(n): return n-1-sum(primepi(integer_nthroot(n,k)[0]) for k in range(2,n.bit_length())) # Chai Wah Wu, Aug 20 2024

A024623 a(n) is the number of prime powers <= 3^n.

Original entry on oeis.org

1, 3, 8, 16, 33, 69, 153, 360, 894, 2294, 6060, 16229, 44126, 121021, 334771, 931905, 2608160, 7333717, 20703268, 58652234, 166684333, 475034096, 1357217584, 3886575564, 11152863757, 32065004164, 92349161271, 266398439961, 769616851854, 2226457643329, 6449248612381, 18703413267318
Offset: 0

Views

Author

Keywords

Comments

a(n) is the position of 3^n among the powers of primes (A000961). - Robert G. Wilson v, Dec 16 2019

Crossrefs

Cf. A000961 (powers of primes), A000244 (powers of 3), A055729, A065515.

Formula

a(n) = A065515(3^n). - Michel Marcus, Dec 15 2019

Extensions

a(18)-a(31) from Robert G. Wilson v, Dec 15 2019

A081063 Number of numbers <= n that are 3-smooth or prime powers.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Mar 04 2003

Keywords

Comments

a(n) = #{A081061(k): 1<=k<=n}.

Crossrefs

Programs

  • Mathematica
    Accumulate[Table[If[PrimePowerQ[n]||Max[FactorInteger[n][[All,1]]]<5,1,0],{n,80}]] (* Harvey P. Dale, Nov 29 2020 *)
  • Python
    from sympy import integer_log, primepi, integer_nthroot
    def A081063(n): return int(1-(a:=n.bit_length())-(b:=integer_log(n,3)[0])+sum((n//3**i).bit_length() for i in range(b+1))+sum(primepi(integer_nthroot(n, k)[0]) for k in range(1, a))) # Chai Wah Wu, Sep 16 2024

Formula

a(n)=A071521(n)+A065515(n)-A000523(n)-A062153(n)+1.

A305974 a(1) = 1; for n > 1, if n = p^k for some prime p and exponent k >= 1, then a(n) = -k, otherwise a(n) = 1+A085970(n).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jul 02 2018

Keywords

Crossrefs

Cf. A000961, A065515, A085970, A095874, A305975 (rgs-transform).

Programs

  • PARI
    up_to = 65537;
    partialsums(f,up_to) = { my(v = vector(up_to), s=0); for(i=1,up_to,s += f(i); v[i] = s); (v); }
    v065515 = partialsums(n -> (omega(n)<=1), up_to);
    A065515(n) = v065515[n];
    A085970(n) = (n - A065515(n));
    A305974(n) = if(1==n,n,my(e = isprimepower(n)); if(e,-e,1+A085970(n)));

Formula

a(1) = 1; for n > 1, if n = p^k for some prime p and exponent k >= 1, then a(n) = -k, otherwise [when n is not a prime power], a(n) = 1+A085970(n) = running count from 2 onward.

A308819 Product of prime powers <= n.

Original entry on oeis.org

1, 1, 2, 6, 24, 120, 120, 840, 6720, 60480, 60480, 665280, 665280, 8648640, 8648640, 8648640, 138378240, 2352430080, 2352430080, 44696171520, 44696171520, 44696171520, 44696171520, 1028011944960, 1028011944960, 25700298624000, 25700298624000, 693908062848000
Offset: 0

Views

Author

Ilya Gutkovskiy, Jun 26 2019

Keywords

Comments

a(n) is the smallest number that's divisible by all numbers less than or equal to n. - Keith F. Lynch, Apr 24 2025

Examples

			a(9) = 60480 because 2, 3, 4, 5, 7, 8, 9 are the prime powers less than or equal to 9 and 2 * 3 * 4 * 5 * 7 * 8 * 9 = 60480.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Product[If[PrimePowerQ[k], k, 1], {k, 1, n}]; Table[a[n], {n, 0, 27}]
    Module[{nn=50,ppwr},ppwr=Select[Range[nn],PrimePowerQ[#]&];Table[Times@@ Select[ ppwr,#<= n&],{n,0,nn}]] (* Harvey P. Dale, Apr 03 2024 *)
  • PARI
    a(n) = prod(k=1, n, if (isprime(k) || isprimepower(k), k, 1)); \\ Michel Marcus, Jun 27 2019

A330669 The prime indices of the prime powers (A000961).

Original entry on oeis.org

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

Views

Author

Grant E. Martin and Robert G. Wilson v, Dec 23 2019

Keywords

Examples

			a(16) is 2 since A000961(16) is 27 which is 3^3 = (p_2)^3, i.e., the prime index of 3 is 2.
		

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; local k; for k from
          1+b(n-1) while nops(ifactors(k)[2])>1 do od; k
        end: b(1):=1:
    a:= n-> `if`(n=1, 0, numtheory[pi](ifactors(b(n))[2, 1$2])):
    seq(a(n), n=1..100);  # Alois P. Heinz, Feb 20 2020
  • Mathematica
    mxn = 500; Join[{0}, Transpose[ Sort@ Flatten[ Table[ {Prime@n^ex, n}, {n, PrimePi@ mxn}, {ex, Log[Prime@n, mxn]}], 1]][[2]]]
  • PARI
    lista(nn) = {print1(0); for(n=2, nn, if(isprimepower(n, &p), print1(", ", primepi(p)))); } \\ Jinyuan Wang, Feb 19 2020
    
  • Python
    from sympy import primepi, integer_nthroot, primefactors
    def A330669(n):
        if n == 1: return 0
        def f(x): return int(n-2+x-sum(primepi(integer_nthroot(x,k)[0]) for k in range(1,x.bit_length())))
        kmin, kmax = 1,2
        while f(kmax) >= kmax:
            kmax <<= 1
        while True:
            kmid = kmax+kmin>>1
            if f(kmid) < kmid:
                kmax = kmid
            else:
                kmin = kmid
            if kmax-kmin <= 1:
                break
        return int(primepi(primefactors(kmax)[0])) # Chai Wah Wu, Aug 20 2024

Formula

a(n) = A000720(A025473(n)). - Michel Marcus, Dec 24 2019
A000040(a(n))^A025474(n) = A000961(n) for n > 0. - Alois P. Heinz, Feb 20 2020
Previous Showing 11-20 of 25 results. Next