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.

A355017 a(n) is the number of bases in 2..n in which the sum of the digits of n is prime.

This page as a plain text file.
%I A355017 #49 Jun 18 2022 19:56:32
%S A355017 0,1,1,3,4,4,3,5,6,7,7,8,7,8,5,11,9,10,8,13,8,12,9,13,11,12,10,15,11,
%T A355017 16,10,17,10,20,12,20,14,18,13,21,13,22,13,20,14,25,14,22,18,22,15,26,
%U A355017 12,29,17,25,15,27,15,30,19,26,14,32,17,33,19,27,19,31,18,34,19,29,19,37,16,33,21,30,24,39,20,38
%N A355017 a(n) is the number of bases in 2..n in which the sum of the digits of n is prime.
%C A355017 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:
%C A355017 Observations:
%C A355017 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).
%C A355017 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).
%C A355017 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).
%C A355017 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).
%C A355017 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.
%H A355017 Samuel Harkness, <a href="/A355017/b355017.txt">Table of n, a(n) for n = 2..10000</a>
%H A355017 Samuel Harkness, <a href="/A355017/a355017_2.jpg">Colored Scatterplot of the first 50000 terms, with n as multiples of 2 or 3</a>
%H A355017 Samuel Harkness, <a href="/A355017/a355017_3.jpg">Colored Scatterplot of the first 50000 terms, with the lowest factor of n among 5, 7, 11, or 13</a>
%H A355017 Rémy Sigrist, <a href="/A355017/a355017.png">Scatterplot of (n, b) such that the sum of digits of n in base b is prime (with n = 1..1000, b = 2..n)</a>.
%H A355017 Rémy Sigrist, <a href="/A355017/a355017_1.png">Colored scatterplot of the first 50000 terms</a> (where the color is function of gcd(n, 2*3*5)).
%e A355017 For n=7, express 7 in all bases from 2 to 7, then add the numbers, counting those which are prime:
%e A355017   base 2: 1 1 1 --> 1+1+1=3 prime
%e A355017   base 3: 2 1   --> 2+1=3   prime
%e A355017   base 4: 1 3   --> 1+3=4   nonprime
%e A355017   base 5: 1 2   --> 1+2=3   prime
%e A355017   base 6: 1 1   --> 1+1=2   prime
%e A355017   base 7: 1     --> 1=1     nonprime
%e A355017 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.
%t A355017 a[n_] := Count[Range[2, n], _?(PrimeQ[Plus @@ IntegerDigits[n, #]] &)]; Array[a, 84, 2] (* _Amiram Eldar_, Jun 17 2022 *)
%o A355017 (PARI) a(n) = sum(b=2, n, isprime(sumdigits(n, b))); \\ _Michel Marcus_, Jun 16 2022
%o A355017 (Python)
%o A355017 from sympy.ntheory import isprime, digits
%o A355017 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
%Y A355017 Cf. A008588, A047235, A016945, A007310, A028834, A052294.
%K A355017 nonn,look
%O A355017 2,4
%A A355017 _Samuel Harkness_, Jun 15 2022