OFFSET
2,4
COMMENTS
The graph of (n,a(n)) shows an interesting structure, somewhat resembling a comet with four tails. Starting at the bottom tail and going upwards:
Observations:
The bottom "tail" contains all n with both 2 and 3 as prime factors, i.e., numbers n in A008588 (1/6 of all n).
The second "tail" contains all n with 2 as a prime factor but not 3, i.e., numbers n in A047235 (1/3 of all n).
The third "tail" contains all n with 3 as a prime factor but 2, i.e., numbers n in A016945 (1/6 of all n).
The top "tail" contains all n with neither 2 nor 3 as a prime factor, i.e., numbers n in A007310 (1/3 of all n).
The bottom of each "tail" contains n with 5 as a prime factor. Moving up within each "tail," the prime factors of each n tend to increase.
LINKS
Samuel Harkness, Table of n, a(n) for n = 2..10000
Samuel Harkness, Colored Scatterplot of the first 50000 terms, with the lowest factor of n among 5, 7, 11, or 13
Rémy Sigrist, Scatterplot of (n, b) such that the sum of digits of n in base b is prime (with n = 1..1000, b = 2..n).
Rémy Sigrist, Colored scatterplot of the first 50000 terms (where the color is function of gcd(n, 2*3*5)).
EXAMPLE
For n=7, express 7 in all bases from 2 to 7, then add the numbers, counting those which are prime:
base 2: 1 1 1 --> 1+1+1=3 prime
base 3: 2 1 --> 2+1=3 prime
base 4: 1 3 --> 1+3=4 nonprime
base 5: 1 2 --> 1+2=3 prime
base 6: 1 1 --> 1+1=2 prime
base 7: 1 --> 1=1 nonprime
The sum of the digits of the base-b expansion of 7 in 4 different bases b (2, 3, 5, and 6) from base 2 to 7 is prime, so a(7)=4.
MATHEMATICA
a[n_] := Count[Range[2, n], _?(PrimeQ[Plus @@ IntegerDigits[n, #]] &)]; Array[a, 84, 2] (* Amiram Eldar, Jun 17 2022 *)
PROG
(PARI) a(n) = sum(b=2, n, isprime(sumdigits(n, b))); \\ Michel Marcus, Jun 16 2022
(Python)
from sympy.ntheory import isprime, digits
def A355017(n): return sum(1 for b in range(2, n) if isprime(sum(digits(n, b)[1:]))) # Chai Wah Wu, Jun 17 2022
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Samuel Harkness, Jun 15 2022
STATUS
approved