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

A196228 Number of ways of writing n as sum of a prime and a perfect power.

Original entry on oeis.org

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

Views

Author

Philippe Deléham, Sep 29 2011

Keywords

Comments

In this case, perfect power does not include 0.
Different from A133364. The first difference is at n=74, where a(n) = 2 but A133364(n) = 3.

Examples

			a(1) = a(2) = a(5) = a(1549) = a(1771561) = 0, see A119748.
		

Crossrefs

Cf. A119748 (zero terms).

Programs

  • Mathematica
    nn = 100; pwrs = Union[{1}, Flatten[Table[Range[2, Floor[nn^(1/ex)]]^ex, {ex, 2, Floor[Log[2, nn]]}]]]; pp = Prime[Range[PrimePi[nn]]]; t = Table[0, {nn}]; Do[ t[[i[[1]]]] = i[[2]], {i, Tally[Sort[Select[Flatten[Outer[Plus, pwrs, pp]], # <= nn &]]]}]; t (* T. D. Noe, Sep 29 2011 *)

Formula

a(n) = Card_{n=i+j where i is in A000040 and j is in A001597}.
G.f.: (Sum_{k>=1} x^prime(k))*(Sum_{k = i^j, i>=1, j>=2} x^k). - Ilya Gutkovskiy, Feb 18 2017

Extensions

Edited by Franklin T. Adams-Watters, Sep 29 2011

A119747 Odd numbers that are not the sum of a prime and a (nontrivial, positive) power.

Original entry on oeis.org

1, 5, 1549, 1771561
Offset: 1

Views

Author

Max Alekseyev, Jul 30 2006, Aug 28 2006

Keywords

Comments

From a question raised by Tanya Khovanova.

Crossrefs

The odd terms of A119748.

A253238 Number of ways to write n as a sum of a perfect power (>1) and a prime.

Original entry on oeis.org

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

Views

Author

Eric Chen, May 17 2015

Keywords

Comments

In this sequence, "perfect power" does not include 0 or 1, "prime" does not include 1. Both "perfect power" and "prime" must be positive.
In the past, I conjectured that a(n) > 0 for all n>24, but this is not true. My PARI program found that a(1549) = 0.
I also asked which a(n) are 1. For example, 331 is a de Polignac number (A006285), so it cannot be written as 2^n+p with p prime, and 331-6^n must divisible by 5, 331-10^n must divisible by 3, ..., 331-18^2 = 331-324 = 7 is prime (and it is the only prime of the form 331-m^n, with m, n natural numbers, m>1, n>1), so a(331) = 1. Similarly, a(3319) = 1. Conjecture: a(n) > 1 for all n > 3319.
This conjecture is not true: a(1771561) = 0. (See A119748)
Another conjecture: For every number m>=0, there is a number k such that a(n)>=m for all n>=k.
Another conjecture: Except for k=2, first occurrence of k must be earlier then first occurrence of k+1.
For n such that a(n) = 0, see A119748.
For n such that a(n) = 1, see the following a-file of this sequence.

Crossrefs

Programs

  • Mathematica
    nn = 128; pwrs = Flatten[Table[Range[2, Floor[nn^(1/ex)]]^ex, {ex, 2, Floor[Log[2, nn]]}]]; pp = Prime[Range[PrimePi[nn]]]; t = Table[0, {nn}]; Do[ t[[i[[1]]]] = i[[2]], {i, Tally[Sort[Select[Flatten[Outer[Plus, pwrs, pp]], # <= nn &]]]}]; t
  • PARI
    a(n) = sum(k=1, n-1, ispower(k) && isprime(n-k))
    
  • PARI
    a(n)=sum(e=2,log(n)\log(2),sum(b=2,sqrtnint(n,e),isprime(n-b^e)&&!ispower(b))) \\ Charles R Greathouse IV, May 28 2015

A365294 a(n) is the least positive integer that can be expressed as the sum of a prime number and a perfect power in exactly n ways.

Original entry on oeis.org

1, 3, 6, 11, 27, 38, 105, 128, 248, 227, 398, 572, 692, 668, 902, 908, 1172, 1448, 2288, 1748, 1592, 2483, 3167, 3932, 3902, 3737, 4457, 3632, 5843, 6443, 6233, 8048, 6992, 5297, 8678, 6368, 8888, 10688, 9908, 8153, 8777, 13163, 14222, 16463, 14528, 14948
Offset: 0

Views

Author

Ilya Gutkovskiy, Aug 31 2023

Keywords

Examples

			For n = 3: 11 = 2 + 3^2 = 3 + 2^3 = 7 + 2^2.
		

Crossrefs

Showing 1-4 of 4 results.