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 31-40 of 694 results. Next

A301573 Distance to nearest perfect power n^k, k>=2 (A001597).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist and Altug Alkan, Mar 23 2018

Keywords

Comments

Differs from A061670 at n=36.
Let b(n) be the smallest t such that a(t) = n. Initial values of b(n) are 1, 0, 6, 12, 20, 41, 42, 56, 72, 90, 110, 155, 156, 182, 270, 271, 272, 306, 379, ...
The b(n) sequence determines the positions of certain humps of a(n) sequence. See scatterplot of this sequence in order to observe general structure of a(n).
b(n) is A366928(n). - Dmitry Kamenetsky, Oct 28 2023

Examples

			a(20) = a(21) = 4 because 16 is the nearest perfect power to 20 and 25 is the nearest perfect power to 21 (20 - 16 = 25 - 21 = 4).
a(36) = 0 because 36 is a square.
		

Crossrefs

Programs

  • PARI
    isA001597(n) = {ispower(n) || n==1}
    a(n) = {my(k=0); while(!isA001597(n+k) && !isA001597(n-k), k++); k;}
    
  • Python
    from itertools import count
    from sympy import perfect_power
    def A301573(n): return next(k for k in count(0) if perfect_power(n+k) or perfect_power(n-k) or n-k==1 or n+k==1) # Chai Wah Wu, Nov 12 2023

Formula

a(n) = 0 iff n belongs to A001597.

A379960 Numbers k such that A276086(k)-1 or A276086(k)+1 is a perfect power (A001597), where A276086 is the primorial base exp-function.

Original entry on oeis.org

1, 2, 4, 6, 7, 8, 13, 30, 34, 35, 36, 212, 214, 248, 254, 421, 2311, 2316, 2318, 2322, 2329, 2350, 2520, 2550, 2564, 2776, 4654, 5076, 9241, 30030, 30037, 30038, 30092, 30120, 30480, 32341, 32347, 32374, 34662, 60066, 510515, 510542, 510547, 510728, 510746, 512850, 512886, 515134, 540540, 540818, 542862, 542888, 1021442
Offset: 1

Views

Author

Antti Karttunen, Jan 22 2025

Keywords

Comments

Most terms seem to cluster after the primorials, A002110. (Compare also to the growth rate of A001597).

Examples

			See examples in A379961 and A379962.
		

Crossrefs

Union of A379961 and A379962.
Cf. also A379963.

Programs

  • PARI
    A276086(n) = { my(m=1, p=2); while(n, m *= (p^(n%p)); n = n\p; p = nextprime(1+p)); (m); };
    is_A379960(n) = { my(x=A276086(n)); (1==(x-1) || ispower(x+1) || ispower(x-1)); };

A380398 The number of unitary divisors of n that are perfect powers (A001597).

Original entry on oeis.org

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

Views

Author

Amiram Eldar, Jan 23 2025

Keywords

Comments

First differs from A368978 at n = 32, from A007424 and A369163 at n = 36, from A278908, A307848, A358260 and A365549 at n = 64, and from A323308 at n = 72.
a(n) depends only on the prime signature of n (A118914).
The record values are 2^k, for k = 0, 1, 2, ..., and they are attained at A061742(k).
The sum of unitary divisors of n that are perfect powers is A380400(n).

Examples

			a(4) = 2 since 4 have 2 unitary divisors that are perfect powers, 1 and 4 = 2^2.
a(72) = 3 since 72 have 3 unitary divisors that are perfect powers, 1, 8 = 2^3, and 9 = 3^2.
		

Crossrefs

Programs

  • Mathematica
    ppQ[n_] := n == 1 || GCD @@ FactorInteger[n][[;; , 2]] > 1; a[n_] := DivisorSum[n, 1 &, CoprimeQ[#, n/#] && ppQ[#] &]; Array[a, 100]
  • PARI
    a(n) = sumdiv(n, d, gcd(d, n/d) == 1 && (d == 1 || ispower(d)));

Formula

a(n) = Sum_{d|n, gcd(d, n/d) == 1} [d in A001597], where [] is the Iverson bracket.
a(n) = A091050(n) - A380399(n).
a(n) = 1 if and only if n is squarefree (A005117).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 1 - Sum_{k>=2} mu(k)*(zeta(k)/zeta(k+1) - 1) = 1.49341326536904597349..., where mu is the Moebius function (A008683).

A076405 Next perfect power having the same least root of n-th perfect power, A001597.

Original entry on oeis.org

1, 8, 16, 27, 32, 125, 81, 64, 216, 343, 128, 243, 1000, 1331, 625, 256, 1728, 2197, 2744, 1296, 3375, 729, 512, 4913, 5832, 2401, 6859, 8000, 9261, 10648, 1024, 12167, 13824, 3125, 17576, 2187, 21952, 24389, 27000, 29791, 10000, 2048, 35937, 39304
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 09 2002

Keywords

Comments

A025478(a(n)) = A025478(n); A001597(a(n)) = A025478(n)*A001597(n).

Examples

			.   n  | A001597(n) | A025478(n)^A025479(n) |  a(n)
. -----+------------+-----------------------+---------------------------
.  13  |       100  |         10^2          | 1000 = 10^3 = A001597(41)
.  14  |       121  |         11^2          | 1331 = 11^3 = A001597(47)
.  15  |       125  |          5^3          |  625 =  5^4 = A001597(34)
.  16  |       128  |          2^7          |  256 =  2^8 = A001597(23)
.  17  |       144  |         12^2          | 1728 = 12^3 = A001597(54).
		

Crossrefs

Cf. A052410.

Programs

  • Haskell
    a076405 n = a076405_list !! (n-1)
    a076405_list = 1 : f (tail $ zip a001597_list a025478_list) where
       f ((p, r) : us) = g us where
         g ((q, r') : vs) = if r' == r then q : f us else g vs
    -- Reinhard Zumkeller, Mar 11 2014
    
  • Mathematica
    ppQ[n_] := GCD @@ Last /@ FactorInteger@# > 1; f[n_] := Block[{fi = Transpose@ FactorInteger@ n}, fi2 = fi[[2]]; Times @@ (fi[[1]]^(fi[[2]] (1 + 1/GCD @@ fi[[2]])))]; lst = Join[{1}, Select[ Range@ 1848, ppQ@# &]]; f /@ lst (* Robert G. Wilson v, Aug 03 2008 *)
  • Python
    from math import gcd
    from sympy import mobius, integer_nthroot, factorint
    def A076405(n):
        if n == 1: return 1
        def f(x): return int(n-2+x+sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,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 kmax*integer_nthroot(kmax, gcd(*factorint(kmax).values()))[0] # Chai Wah Wu, Aug 13 2024

Extensions

More terms from Robert G. Wilson v, Aug 03 2008

A118895 Numbers n with property that both n and its digit reversal are perfect powers (i.e., in A001597).

Original entry on oeis.org

1, 4, 8, 9, 100, 121, 144, 169, 343, 400, 441, 484, 676, 900, 961, 1000, 1089, 1331, 8000, 9801, 10000, 10201, 10404, 10609, 12100, 12321, 12544, 12769, 14400, 14641, 14884, 16900, 40000, 40401, 40804, 44100, 44521, 44944, 48400, 48841, 67600
Offset: 1

Views

Author

Joshua Zucker, May 04 2006

Keywords

Comments

An alternate version of A110811, which doesn't include the terms with trailing zeros.

Examples

			100 is in the sequence because 100 and 001 = 1 are both perfect powers;
44521 and 12544 are both in the sequence because both are perfect powers, 221^2 and 112^2.
		

Crossrefs

This sequence is a subset of both A115656 and A001597 and contains A110811.
Cf. A118715.

Extensions

Edited by N. J. A. Sloane, Oct 11 2008

A137354 Lexicographically earliest subsequence of the perfect powers in A001597 such that first differences are an increasing sequence of primes.

Original entry on oeis.org

1, 4, 9, 16, 27, 64, 125, 196, 12167, 28224, 68921, 115600, 177147, 244036, 421875, 614656, 970299, 1378276, 2460375, 3556996, 4657463, 5760000, 9129329, 12531600, 16974593, 21436900, 26730899, 32035600, 39135393, 46240000, 53582633
Offset: 1

Views

Author

R. J. Mathar, Mar 07 2008

Keywords

Crossrefs

A variant of A113495. Partial sums of A137355.

Programs

Extensions

a(22)-a(32) from Robert G. Wilson v, Apr 20 2010

A175053 Perfect powers (members of A001597) n where the next larger perfect power is not congruent mod 2 to n.

Original entry on oeis.org

1, 8, 9, 16, 27, 36, 49, 64, 81, 100, 125, 144, 169, 216, 243, 256, 289, 324, 361, 400, 441, 512, 529, 576, 625, 676, 729, 784, 841, 900, 961, 1024, 1089, 1156, 1225, 1296, 1369, 1444, 1521, 1600, 1681, 1764, 1849, 1936, 2025, 2116, 2209, 2304, 2401, 2500
Offset: 1

Views

Author

Leroy Quet, Dec 08 2009

Keywords

Examples

			125 (125 = 5^3) and 128 (128 = 2^7) are consecutive perfect powers. Since one of these is odd and the other is even, then 125 is in this sequence.
		

Crossrefs

Programs

  • Maple
    N:= 3000:
    PP:= {1,seq(seq(i^k,i=2..floor(N^(1/k))),k=2..ilog2(N))}:
    PP:= sort(convert(PP,list)):
    PP[select(t -> PP[t+1] mod 2 <> PP[t] mod 2,[$1..nops(PP)-1])]; # Robert Israel, May 21 2025

Extensions

Extended by Ray Chandler, Dec 10 2009

A265328 Carmichael numbers (A002997) k such that k-1 is a perfect power (A001597).

Original entry on oeis.org

1729, 46657, 2433601, 2628073, 19683001, 67371265, 110592000001, 351596817937, 422240040001, 432081216001, 2116874304001, 3176523000001, 18677955240001, 458631349862401, 286245437364810001, 312328165704192001, 12062716067698821000001, 20717489165917230086401, 211215936967181638848001, 411354705193473163968001
Offset: 1

Views

Author

Altug Alkan, Dec 07 2015

Keywords

Comments

From Antti Karttunen, Dec 08 2015: (Start)
The prime factorizations of the first six terms are:
7*13*19, 13*37*97, 17*37*53*73, 7*37*73*139, 13*37*151*271, 5*13*37*109*257
and the prime factorizations of the corresponding perfect powers (numbers one smaller) are:
(2^6 * 3^3), (2^6 * 3^6), (2^6 * 3^2 * 5^2 * 13^2), (2^3 * 3^3 * 23^3), (2^3 * 3^9 * 5^3), (2^8 * 3^6 * 19^2).
(End)
For each k in {22934100, 59553720, 74371320, 242699310, 3190927740, 9214178820, 84855997590}, which is a subset of A270840, k^3+1 is a Carmichael number. - Daniel Suteu, Aug 24 2019
Wagstaff (2024) found that there are no Carmichael numbers k below 10^21 such that k+1 is a perfect power. - Amiram Eldar, Dec 29 2024

Examples

			1729 = 7*13*19 is a term because 1729 - 1 = 1728 = 12^3, and 7-1 = 6, 13-1 = 12 and 19-1 = 18 can be all constructed from the primes available in 1728 = (2^6 * 3^3).
2433601 = 17*37*53*73 is a term because 2433601 - 1 = 2433600 = 1560^2, and 16, 36, 52 and 72 can be all constructed from the primes available in 2433600 = (2^6 * 3^2 * 5^2 * 13^2).
67371265 = 5*13*37*109*257 is a term because 67371264 = 8208^2, and 4 (= 2*2), 12 (= 2*2*3), 36 (= 2*2*3*3), 108 (= 2*2*3*3*3) and 256 (= 2^8) can be all constructed from the primes available in 67371264 = (2^8 * 3^6 * 19^2).
		

Crossrefs

Contains A265285 as a subsequence.

Programs

  • Mathematica
    Select[Cases[Range[1, 10^7, 2], n_ /; Mod[n, CarmichaelLambda@ n] == 1 && ! PrimeQ@ n], GCD @@ FactorInteger[# - 1][[All, 2]] > 1 &] (* Michael De Vlieger, Dec 14 2015, after Ant King at A001597 and Artur Jasinski at A002997 *)
  • PARI
    is_c(n)={my(f); bittest(n, 0) && !for(i=1, #f=factor(n)~, (f[2, i]==1 && n%(f[1, i]-1)==1)||return) && #f>1}
    for(n=1, 1e10, if(is_c(n) && ispower(n-1), print1(n, ", ")))
    
  • Perl
    use ntheory ":all"; foroddcomposites { say if is_power($-1) && is_carmichael($) } 1e8; # Dana Jacobsen, May 05 2017

Extensions

More terms from Dana Jacobsen, May 05 2017
a(17) from Daniel Suteu confirmed, a(18)-a(20) added by Max Alekseyev, Apr 25 2024

A362425 Number of partitions of n into 3 distinct perfect powers (A001597).

Original entry on oeis.org

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

Views

Author

Ilya Gutkovskiy, Apr 19 2023

Keywords

Crossrefs

Programs

A363040 a(n) is the smallest number which can be represented as the sum of n distinct perfect powers (A001597) in exactly n ways, or -1 if no such number exists.

Original entry on oeis.org

1, 17, 37, 53, 86, 119, 177, 215, 275, 331, 424, 516, 632, 764, 928, 1057, 1247, 1427, 1635, 1879, 2119, 2409, 2715, 3008, 3395, 3760, 4189, 4667, 5171, 5617, 6178, 6786, 7438, 8071, 8836, 9572, 10456, 11333, 12396, 13266, 14214, 15379, 16518, 17703, 19018, 20275
Offset: 1

Views

Author

Ilya Gutkovskiy, May 14 2023

Keywords

Examples

			For n = 2: 17 = 1 + 16 = 8 + 9.
		

Crossrefs

Extensions

a(13) and beyond from Michael S. Branicky, May 24 2023
Previous Showing 31-40 of 694 results. Next