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

A321393 a(n) is the number of bases b > 1 such that n + digitsum(n, base b) is prime.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Nov 08 2018

Keywords

Comments

For any n > 1 and b > n, n + digitsum(n, base b) equals 2*n and is composite, hence the sequence is well defined.
The sequence is not defined for n = 1 as 1 + digitsum(1, base b) equals 2 and is prime for any base b > 1.
In the scatterplot of the sequence, the points are separated into two beams according to whether n is divisible by 3 or not, then these beams are separated in two according to whether n is divisible by 5 or not, then similarly according to whether n is divisible by 7 or not; these separations seem to continue for each odd prime number; see scatterplot in Links section.

Examples

			For n = 9, we have:
  b     9 + sumdigits(9, base b)
  ----  ------------------------
     2   11 (prime)
     3   10
     4   12
     5   14
     6   13 (prime)
     7   12
     8   11 (prime)
     9   10
  >=10   18
Hence, a(9) = 3.
		

Crossrefs

Cf. A321392.

Programs

  • PARI
    a(n) = sum(b=2, n, isprime(n + sumdigits(n, b)))
Showing 1-1 of 1 results.