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 41-50 of 214 results. Next

A301630 a(n) = distance of n-th prime to nearest prime power p^k, k=0 and k >= 2 (A025475).

Original entry on oeis.org

1, 1, 1, 1, 2, 3, 1, 3, 2, 2, 1, 5, 8, 6, 2, 4, 5, 3, 3, 7, 8, 2, 2, 8, 16, 20, 18, 14, 12, 8, 1, 3, 9, 11, 20, 18, 12, 6, 2, 4, 10, 12, 22, 24, 28, 30, 32, 20, 16, 14, 10, 4, 2, 5, 1, 7, 13, 15, 12, 8, 6, 4, 18, 22, 24, 26, 12, 6, 4, 6, 8, 2, 6, 12, 18, 22, 28, 36, 40, 48, 58, 60, 70, 72, 73, 69, 63, 55
Offset: 1

Views

Author

Altug Alkan, Mar 24 2018

Keywords

Examples

			a(9) = a(10) = 2 because 5^2 is the nearest prime power (A025475) to prime(9) = 23 and 3^3 is the nearest prime power (A025475) to prime(10) = 29.
		

Crossrefs

There are four different sequences which may legitimately be called "prime powers": A000961 (p^k, k >= 0), A246655 (p^k, k >= 1), A246547 (p^k, k >= 2), A025475 (p^k, k=0 and k >= 2).

Programs

  • Maple
    Primes:= select(isprime, [2,seq(i,i=3..1000,2)]):
    Ppows:= sort([1,seq(seq(p^j, j=2..floor(log[p](1000))),p=Primes)]):
    for n from 1 while Primes[n] < Ppows[-1] do
      i:= ListTools:-BinaryPlace(Ppows,Primes[n]);
      A[n]:= min(Primes[n]-Ppows[i],Ppows[i+1]-Primes[n])
    od:
    seq(A[i],i=1..n-1); # Robert Israel, Mar 26 2018
  • PARI
    isA025475(n) = {isprimepower(n) && !isprime(n) || n==1}
    a(n) = {my(k=1, p=prime(n)); while(!isA025475(p+k) && !isA025475(p-k), k++); k; }

Formula

a(n) = A061670(A000040(n)).

A331701 Prime powers (A025475) that can be represented as a sum of two prime powers.

Original entry on oeis.org

8, 9, 16, 25, 32, 64, 81, 125, 128, 256, 512, 1024, 2048, 4096, 5041, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, 2147483648, 4294967296, 8589934592
Offset: 1

Views

Author

Alex Ratushnyak, Jan 25 2020

Keywords

Comments

A000079 is a subsequence, starting from the 4th term, 2^3.
The subsequence of odd terms begins: 9, 25, 81, 125, 5041.

Examples

			9 = 8 + 1.
25 = 16 + 9.
81 = 49 + 32.
125 = 121 + 4.
5041 = 71^2 = 4913 + 128 = 17^3 + 2^7.
		

Crossrefs

Programs

  • Mathematica
    Select[#, Last@ # == 1 &][[All, 1]] &@ Fold[Function[{s, k}, Append[s, If[And[! PrimeQ@ k, DivisorSigma[1, k]*EulerPhi[k] > (k - 1)^2], {k, If[AnyTrue[IntegerPartitions[k, {2}], SubsetQ[s[[All, 1]], #] &], 1, 0]}, Nothing]]], {}, Range[10^4]] (* Michael De Vlieger, Jan 31 2020 *)
  • Python
    from sympy import isprime
    TOP = 10**5
    primePowers={}
    primePowers[1]=1
    for x in range(2,TOP):
        if isprime(x):
            p = pp = x
            while pp < TOP**2:
                pp *= p
                primePowers[pp] = 1
    a=[]
    pps = sorted(primePowers.keys())[:]
    for pp in pps:
        for p in pps:
            if p*2 > pp: break
            if (pp-p) in primePowers:
                print(pp)
                a.append(pp)
                break
    print(sorted(a))

A062559 A B2 sequence consisting of powers of primes but not primes: a(n) = least value from A025475 such that sequence increases and pairwise sums of distinct elements are all distinct.

Original entry on oeis.org

4, 8, 9, 16, 25, 27, 49, 64, 121, 243, 256, 343, 512, 729, 961, 1024, 1331, 1369, 1849, 2048, 2187, 2197, 2401, 3125, 3481, 4096, 4913, 5329, 6561, 6859, 6889, 8192, 10201, 12769, 14641, 15625, 16384, 16807, 19683, 22201, 22801, 27889, 28561, 29791, 32768
Offset: 0

Views

Author

Labos Elemer, Jul 03 2001

Keywords

Comments

32 is the first prime power > 1 not in this sequence.

Crossrefs

Programs

  • Python
    from itertools import count, islice
    from sympy import factorint
    def A062559_gen(): # generator of terms
        aset2, alist = set(), []
        for k in count(0):
            if len(f:=factorint(k).values()) == 1 and max(f) > 1:
                bset2 = set()
                for a in alist:
                    if (b:=a+k) in aset2:
                        break
                    bset2.add(b)
                else:
                    yield k
                    alist.append(k)
                    aset2.update(bset2)
    A062559_list = list(islice(A062559_gen(),30)) # Chai Wah Wu, Sep 11 2023

Extensions

More terms from Sean A. Irvine, Apr 03 2023

A065746 Number of divisors of squares of all true powers of primes: a(n) = A000005(A025475(n+1)^2).

Original entry on oeis.org

5, 7, 5, 9, 5, 7, 11, 5, 13, 9, 5, 7, 15, 5, 11, 17, 5, 7, 5, 19, 5, 9, 13, 5, 5, 21, 7, 5, 5, 5, 23, 15, 7, 5, 9, 5, 11, 5, 5, 25, 5, 7, 5, 5, 5, 17, 7, 5, 5, 27, 5, 5, 5, 5, 5, 7, 5, 9, 13, 5, 29, 11, 5, 5, 5, 19, 5, 5, 7, 5, 5, 5, 9, 7, 5, 5, 5, 31, 5, 5, 5, 5, 5, 5, 7, 5, 5, 5, 5, 5, 21, 5, 33
Offset: 1

Views

Author

Labos Elemer, Nov 16 2001

Keywords

Examples

			tau(p^(2c)) = 2c+1 is prime if c = (odd prime -1)/2 = 1, 2, 3, 5, 6, 8, ... = A005097.
		

Crossrefs

Programs

  • Mathematica
    DivisorSigma[0, Select[Range[60000], ! PrimeQ[#] && PrimePowerQ[#] &]^2] (* Amiram Eldar, Apr 13 2024 *)

Formula

tau(p^(2c)), where tau is the number of divisors, c > 1 and p is prime.

Extensions

Name corrected by Amiram Eldar, Apr 13 2024

A068343 a(n) is a prime power and sum of all prime powers <= a(n) is A025475.

Original entry on oeis.org

1, 2111, 43997, 69499
Offset: 1

Views

Author

Naohiro Nomoto, Mar 08 2002

Keywords

Comments

No other terms up to 10^9. - Michel Marcus, Mar 26 2020
a(5) > 10^12, if it exists. - Giovanni Resta, Apr 12 2020

Examples

			2111 is a term because 1+2+3+4+5+7+8+..+2111 = 323761 = 569^2.
		

Crossrefs

Programs

  • PARI
    ispp1(n) = isprimepower(n) || (n==1); \\ A000961
    ispp2(n) = ispower(n, , &p) && isprime(p) || n==1; \\ A025475
    lista(nn) = {my(s=0); for (n=1, nn, if (ispp1(n), s += n; if (ispp2(s), print1(n, ", "));););} \\ Michel Marcus, Mar 26 2020

A077274 Differences between two successive powers of a prime but not a prime (A025475) in more than one way.

Original entry on oeis.org

4, 7, 17, 408, 792, 912, 1608, 1848, 2472, 2912, 3192, 3288, 3432, 3528, 4008, 4080, 4920, 5160, 5208, 5928, 6072, 6792, 6888, 7080, 7512, 7728, 7800, 8520, 8832, 10632, 10848, 11400, 11880, 11928, 12792, 13200, 13440, 13560, 14280, 14640
Offset: 1

Views

Author

Robert G. Wilson v, Oct 31 2002

Keywords

Examples

			4 = 8 - 4 = 125 - 121.
7 = 16 - 9 = 32768 - 32761.
17 = 49 - 32 = 81 - 64 = 529 - 512.
		

Crossrefs

Cf. A025475.

Programs

  • Mathematica
    pp = Sort[ Flatten[ Table[ Prime[n]^i, {n, 1, PrimePi[ Sqrt[10^10]]}, {i, 2, Log[ Prime[n], 10^10]}]]]; l = Length[pp]; b = Sort[ Take[pp, -l + 1] - Take[pp, l - 1]]; Union[ b[[ Select[ Range[375], b[[ # ]] == b[[ # + 1]] &]]]]

A136335 Indices of the primes p for which the number of representations of p as the sum of a perfect prime power (A025475: q^e with e>1) and an integer k which is less than q exceeds one.

Original entry on oeis.org

10, 31, 14774, 14775, 65686, 110128, 110129, 110130, 110131, 110132, 110133, 110134, 110135, 110136, 110137, 165952, 165953, 165954, 165955, 165956, 165957, 165958, 304841, 304842, 304843, 304844, 304845, 304846, 304847
Offset: 1

Views

Author

Keywords

Comments

Where A138363 exceeds 1.

Examples

			A000040(10)=29; A138363(10) = #{4+5^2, 2+3^3} = 2.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{c = 0, e, j, k = 1, p = Prime@n, q}, j = 1 + PrimePi@ Sqrt@ p; While[k < j, q = Prime@k; If[p < q + q^Floor@ Log[q, p], c++ ]; k++ ]; c]; lst = {}; Do[ If[f@n > 1, AppendTo[lst, n]; Print[Prime@n]], {n, 25*10^5}]

A221563 Triangular numbers representable as t*p, where t>1 is a triangular number, p>1 is a prime power (A025475).

Original entry on oeis.org

120, 528, 1485, 3240, 58653, 70125, 139128, 609960, 886446, 902496, 1062153, 1844160, 4017195, 8386560, 8759205, 38618866, 39760903, 122062500, 160554240, 703893960, 741105750, 797222415, 6115239936, 10854464130, 23667373395, 82103447700, 131197213890
Offset: 1

Views

Author

Alex Ratushnyak, May 03 2013

Keywords

Examples

			Triangular(32) = 528 = 66 * 8, because 66 is a triangular number and 8 is a prime power, 528 is in the sequence.
Triangular(54) = 1485 = 55 * 27, because 55 is a triangular number and 27 is a prime power, 1485 is in the sequence.
		

Crossrefs

A225300 Terms in A025475 that are palindromes in base 2.

Original entry on oeis.org

1, 9, 27, 20457529, 87463589042698969
Offset: 1

Views

Author

Alex Ratushnyak, May 04 2013

Keywords

Examples

			9 = 1001_2.
27 = 11011_2.
20457529 = 1001110000010100000111001_2.
		

Crossrefs

Intersection of A006995 and A025475.
Cf. A029983.

Extensions

Definition clarified by Chai Wah Wu, Mar 18 2018

A225675 Numbers n such that triangular(n) is representable as p*w, where p is a prime number and w is a prime power (A025475).

Original entry on oeis.org

2, 7, 9, 16, 17, 18, 25, 26, 31, 53, 81, 97, 121, 127, 162, 241, 250, 256, 337, 361, 486, 577, 625, 841, 1249, 1458, 2186, 2401, 2662, 3361, 3481, 3697, 3721, 4373, 4801, 5041, 6241, 6961, 8191, 10201, 10657, 13121, 14641, 17161, 19321, 23761, 25537, 28561, 31249, 32257
Offset: 1

Views

Author

Alex Ratushnyak, May 12 2013

Keywords

Comments

Corresponding triangular numbers are in A225674.
The subsequence of even terms begins: 2, 16, 18, 26, 162, 250, 256, 486, 1458, 2186, 2662, 39366, 48778, 65536, 410758, 715822, 1594322, 2450086, 6615898, 12872686, 13935742, 15290746, 23394166, 38930218, 41022298, 86093442, ...

Crossrefs

Previous Showing 41-50 of 214 results. Next