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

A378371 Distance between n and the least non prime power >= n, allowing 1.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Nov 28 2024

Keywords

Comments

Non prime powers allowing 1 (A361102) are numbers that are not a prime power (A246655), namely 1, 6, 10, 12, 14, 15, 18, 20, 21, 22, 24, ...

Examples

			The least non prime power >= 4 is 6, so a(4) = 2.
		

Crossrefs

Sequences obtained by adding n to each term are placed in parentheses below.
For prime we have A007920 (A151800), strict A013632.
For composite we have A010051 (A113646 except initial terms).
For perfect power we have A074984 (A377468)
For squarefree we have A081221 (A067535).
For nonsquarefree we have (A120327).
For non perfect power we have A378357 (A378358).
The opposite version is A378366 (A378367).
For prime power we have A378370, strict A377282 (A000015).
This sequence is A378371 (A378372).
A000040 lists the primes, differences A001223.
A000961 and A246655 list the prime powers, differences A057820.
A024619 and A361102 list the non prime powers, differences A375708 and A375735.
Prime powers between primes: A053607, A080101, A304521, A366833, A377057.

Programs

  • Mathematica
    Table[NestWhile[#+1&,n,PrimePowerQ[#]&]-n,{n,100}]

Formula

a(n) = A378372(n) - n.

A378372 Least non prime power >= n, allowing 1.

Original entry on oeis.org

1, 6, 6, 6, 6, 6, 10, 10, 10, 10, 12, 12, 14, 14, 15, 18, 18, 18, 20, 20, 21, 22, 24, 24, 26, 26, 28, 28, 30, 30, 33, 33, 33, 34, 35, 36, 38, 38, 39, 40, 42, 42, 44, 44, 45, 46, 48, 48, 50, 50, 51, 52, 54, 54, 55, 56, 57, 58, 60, 60, 62, 62, 63, 65, 65, 66, 68
Offset: 1

Views

Author

Gus Wiseman, Nov 29 2024

Keywords

Comments

Non prime powers allowing 1 (A361102) are numbers that are not a prime power (A246655), namely 1, 6, 10, 12, 14, 15, 18, 20, 21, 22, 24, ...

Examples

			The least non prime power >= 4 is 6, so a(4) = 6.
		

Crossrefs

Sequences obtained by subtracting n from each term are placed in parentheses below.
For prime power we have A000015 (A378370).
For squarefree we have A067535 (A081221).
For composite we have A113646 (A010051).
For nonsquarefree we have A120327.
For prime we have A151800 (A007920), strict (A013632).
Run-lengths are 1 and A375708.
For perfect power we have A377468 (A074984).
For non-perfect power we have A378358 (A378357).
The opposite is A378367, distance A378366.
This sequence is A378372 (A378371).
A000040 lists the primes, differences A001223.
A000961 and A246655 list the prime powers, differences A057820.
A024619 and A361102 list the non prime powers, differences A375708 and A375735.
Prime powers between primes: A053607, A080101, A304521, A366833, A377057.

Programs

  • Mathematica
    Table[NestWhile[#+1&,n,PrimePowerQ[#]&],{n,100}]

Formula

a(n) = A378371(n) + n.

A179278 Largest nonprime integer <= n.

Original entry on oeis.org

1, 1, 1, 4, 4, 6, 6, 8, 9, 10, 10, 12, 12, 14, 15, 16, 16, 18, 18, 20, 21, 22, 22, 24, 25, 26, 27, 28, 28, 30, 30, 32, 33, 34, 35, 36, 36, 38, 39, 40, 40, 42, 42, 44, 45, 46, 46, 48, 49, 50, 51, 52, 52, 54, 55, 56, 57, 58, 58, 60, 60, 62, 63, 64, 65, 66, 66, 68, 69, 70, 70, 72
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 08 2010

Keywords

Examples

			From _Gus Wiseman_, Dec 04 2024: (Start)
The nonprime integers <= n:
  1  1  1  4  4  6  6  8  9  10  10  12  12  14  15  16
           1  1  4  4  6  8  9   9   10  10  12  14  15
                 1  1  4  6  8   8   9   9   10  12  14
                       1  4  6   6   8   8   9   10  12
                          1  4   4   6   6   8   9   10
                             1   1   4   4   6   8   9
                                     1   1   4   6   8
                                             1   4   6
                                                 1   4
                                                     1
(End)
		

Crossrefs

For prime we have A007917.
For nonprime we have A179278 (this).
For squarefree we have A070321.
For nonsquarefree we have A378033.
For prime power we have A031218.
For non prime power we have A378367.
For perfect power we have A081676.
For non perfect power we have A378363.
A000040 lists the primes, differences A001223.
A002808 lists the composite numbers, differences A073783.
A018252 lists the nonprimes, differences A065310.
A095195 has row n equal to the k-th differences of the prime numbers.
A113646 gives least nonprime >= n.
A151800 gives the least prime > n, weak version A007918.
A377033 has row n equal to the k-th differences of the composite numbers.

Programs

  • Mathematica
    Array[# - Boole[PrimeQ@ #] - Boole[# == 3] &, 72] (* Michael De Vlieger, Oct 13 2018 *)
    Table[Max@@Select[Range[n],!PrimeQ[#]&],{n,30}] (* Gus Wiseman, Dec 04 2024 *)
  • PARI
    a(n) = if (isprime(n), if (n==3, 1, n-1), n); \\ Michel Marcus, Oct 13 2018

Formula

For n > 3: a(n) = A113523(n) = A014684(n);
For n > 0: a(n) = A113638(n). - Georg Fischer, Oct 12 2018
A005171(a(n)) = 1; A010051(a(n)) = 0.
a(n) = A018252(A062298(n)). - Ridouane Oudra, Aug 22 2025

Extensions

Inequality in the name reversed by Gus Wiseman, Dec 05 2024

A378363 Greatest number <= n that is 1 or not a perfect-power.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Nov 24 2024

Keywords

Comments

Perfect-powers (A001597) are 1 and numbers with a proper integer root, complement A007916.

Examples

			In the non-perfect-powers ... 5, 6, 7, 10, 11 ... the greatest term <= 8 is 7, so a(8) = 7.
		

Crossrefs

The union is A007916, complement A001597.
The version for prime numbers is A007917 or A151799, opposite A159477.
The version for prime-powers is A031218, opposite A000015.
The version for squarefree numbers is A067535, opposite A070321.
The version for perfect-powers is A081676, opposite A377468.
The version for composite numbers is A179278, opposite A113646.
Terms appearing multiple times are A375704, opposite A375703.
The run-lengths are A375706.
Terms appearing only once are A375739, opposite A375738.
The version for nonsquarefree numbers is A378033, opposite A120327.
The opposite version is A378358.
Subtracting n gives A378364, opposite A378357.
The version for non-prime-powers is A378367 (subtracted A378371), opposite A378372.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820.
A001597 lists the perfect-powers, differences A053289.
A007916 lists the non-perfect-powers, differences A375706.
A069623 counts perfect-powers <= n.
A076411 counts perfect-powers < n.
A131605 lists perfect-powers that are not prime-powers.
A377432 counts perfect-powers between primes, zeros A377436.

Programs

  • Mathematica
    perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
    Table[NestWhile[#-1&,n,#>1&&perpowQ[#]&],{n,100}]
  • Python
    from sympy import mobius, integer_nthroot
    def A378363(n):
        def f(x): return int(1-sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,x.bit_length())))
        a = n-f(n)
        m, k = a, f(a)+a
        while m != k: m, k = k, f(k)+a
        return m # Chai Wah Wu, Nov 26 2024

A378457 Difference between n and the greatest prime power <= n, allowing 1.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Nov 29 2024

Keywords

Comments

Prime powers allowing 1 are listed by A000961.

Examples

			The greatest prime power <= 6 is 5, so a(6) = 1.
		

Crossrefs

Sequences obtained by subtracting each term from n are placed in parentheses below.
For nonprime we have A010051 (almost) (A179278).
Subtracting from n gives (A031218).
For prime we have A064722 (A007917).
For perfect power we have A069584 (A081676).
For squarefree we have (A070321).
Adding one gives A276781.
For nonsquarefree we have (A378033).
For non perfect power we have (A378363).
For non prime power we have A378366 (A378367).
The opposite is A378370 = A377282-1.
A000015 gives the least prime power >= n.
A000040 lists the primes, differences A001223.
A000961 and A246655 list the prime powers, differences A057820.
A024619 and A361102 list the non prime powers, differences A375708 and A375735.
A151800 gives the least prime > n, weak version A007918.
Prime powers between primes: A053607, A080101, A304521, A366833, A377057.

Programs

  • Mathematica
    Table[n-NestWhile[#-1&,n,#>1&&!PrimePowerQ[#]&],{n,100}]

Formula

a(n) = n - A031218(n).
a(n) = A276781(n) - 1.

A378366 Difference between n and the greatest non prime power <= n (allowing 1).

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Nov 29 2024

Keywords

Comments

Non prime powers allowing 1 (A361102) are numbers that are not a prime power (A246655), namely 1, 6, 10, 12, 14, 15, 18, 20, 21, 22, 24, ...

Crossrefs

Sequences obtained by subtracting each term from n are placed in parentheses below.
For nonprime we almost have A010051 (A179278).
For prime we have A064722 (A007917).
For perfect power we have A069584 (A081676).
For squarefree we have (A070321).
For prime power we have A378457 = A276781-1 (A031218).
For nonsquarefree we have (A378033).
For non perfect power we almost have A075802 (A378363).
Subtracting from n gives (A378367).
The opposite is A378371, adding n A378372.
A000015 gives the least prime power >= n (cf. A378370 = A377282 - 1).
A000040 lists the primes, differences A001223.
A000961 and A246655 list the prime powers, differences A057820.
A024619 and A361102 list the non prime powers, differences A375708 and A375735.
A151800 gives the least prime > n, weak version A007918.
Prime powers between primes: A053607, A080101, A304521, A366833, A377057.

Programs

  • Mathematica
    Table[n-NestWhile[#-1&,n,PrimePowerQ[#]&],{n,100}]

Formula

a(n) = n - A378367(n).

A378616 Greatest non prime power <= prime(n).

Original entry on oeis.org

1, 1, 1, 6, 10, 12, 15, 18, 22, 28, 30, 36, 40, 42, 46, 52, 58, 60, 66, 70, 72, 78, 82, 88, 96, 100, 102, 106, 108, 112, 126, 130, 136, 138, 148, 150, 156, 162, 166, 172, 178, 180, 190, 192, 196, 198, 210, 222, 226, 228, 232, 238, 240, 250, 255, 262, 268, 270
Offset: 1

Views

Author

Gus Wiseman, Dec 06 2024

Keywords

Comments

Conjecture: Equal to A006093(n) = prime(n) - 1 except at terms of A159611.

Examples

			The first number line below shows the non prime powers. The second shows the primes:
--1-------------6----------10----12----14-15-------18----20-21-22----24--
=====2==3====5=====7==========11====13==========17====19==========23=====
		

Crossrefs

For nonprime instead of non prime power we have A156037.
Restriction of A378367.
Lengths are A378615.
For nonsquarefree: A378032 (diffs A378034), restriction of A378033 (diffs A378036).
A000040 lists the primes, differences A001223
A000961 and A246655 list the prime powers, differences A057820.
A024619 lists the non prime powers, differences A375735, seconds A376599.
A080101 counts prime powers between primes (exclusive), inclusive A366833.
A361102 lists the non powers of primes, differences A375708.
Prime powers between primes:
- A377057 positive
- A377286 zero
- A377287 one
- A377288 two

Programs

  • Mathematica
    Table[Max[Select[Range[Prime[n]],Not@*PrimePowerQ]],{n,100}]
Showing 1-7 of 7 results.