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.

A355035 Consider the least base b >= 2 where the sum of digits of n is a prime number; a(n) corresponds to this prime number.

This page as a plain text file.
%I A355035 #10 Jun 18 2022 07:43:24
%S A355035 2,2,2,2,2,3,2,2,2,3,2,3,3,3,2,2,2,3,2,3,3,5,2,3,3,3,3,3,2,5,2,2,2,3,
%T A355035 2,3,3,3,2,3,3,5,3,3,7,5,2,3,3,5,3,7,2,5,3,3,7,5,5,5,5,3,13,2,2,3,2,3,
%U A355035 3,7,2,3,3,5,3,7,3,5,2,3,3,3,3,3,5,5,3
%N A355035 Consider the least base b >= 2 where the sum of digits of n is a prime number; a(n) corresponds to this prime number.
%H A355035 Rémy Sigrist, <a href="/A355035/b355035.txt">Table of n, a(n) for n = 2..10000</a>
%F A355035 a(n) = A216789(n, A355034(n)).
%e A355035 For n = 16:
%e A355035 - we have the following expansions and sum of digits:
%e A355035      b  16_b     Sum of digits in base b
%e A355035      -  -------  -----------------------
%e A355035      2  "10000"                        1
%e A355035      3    "121"                        4
%e A355035      4    "100"                        1
%e A355035      5     "31"                        4
%e A355035      6     "24"                        6
%e A355035      7     "22"                        4
%e A355035      8     "20"                        2
%e A355035 - so a(16) = 2.
%o A355035 (PARI) a(n) = my (s); for (b=2, oo, if (isprime(s=sumdigits(n,b)), return (s)))
%o A355035 (Python)
%o A355035 from sympy import isprime
%o A355035 from sympy.ntheory.digits import digits
%o A355035 def s(n, b): return sum(digits(n, b)[1:])
%o A355035 def a(n):
%o A355035     b = 2
%o A355035     while not isprime(s(n, b)): b += 1
%o A355035     return s(n, b)
%o A355035 print([a(n) for n in range(2, 89)]) # _Michael S. Branicky_, Jun 16 2022
%Y A355035 Cf. A216789, A355034 (corresponding b's).
%K A355035 nonn,base
%O A355035 2,1
%A A355035 _Rémy Sigrist_, Jun 16 2022