login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A271628 Primes that are the sum of the digits of the numbers from 1 to n, for some n. 1
3, 73, 109, 127, 433, 1009, 1117, 1801, 2017, 2089, 2143, 2467, 2503, 2791, 3079, 3331, 3583, 4159, 4519, 4663, 4951, 5437, 5581, 5923, 6121, 6301, 6553, 7039, 7561, 8353, 8623, 8821, 9001, 9199, 9631, 9811, 10837, 11719, 12637, 13177, 13249, 13627, 14401, 15391 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
The sum of the digits of 1 and 2 is a prime: 1 + 2 = 3.
The sum of the digits of the number from 1 to 16 is a prime: 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 1 + 0 + 1 + 1 + 1 + 2 + 1 + 3 + 1 + 4 + 1 + 5 + 1 + 6 = 73.
MAPLE
with(numtheory): P:=proc(q) local a, b, c, k, n; a:=0;
for n from 0 to q do b:=0; c:=n; for k from 1 to ilog10(n)+1 do b:=b+(c mod 10); c:=trunc(c/10); od; a:=a+b;
if isprime(a) then print(a); fi; od; end: P(10^6);
MATHEMATICA
Select[Accumulate@ Map[Total@ IntegerDigits@ # &, Range[0, 1200]], PrimeQ] (* Michael De Vlieger, Apr 11 2016 *)
PROG
(PARI) lista(nn) = for (n=1, nn, if (isprime(p=sum(k=1, n, sumdigits(k))), print1(p, ", "))); \\ Michel Marcus, Apr 11 2016
CROSSREFS
Sequence in context: A006270 A248042 A139888 * A079594 A089922 A259848
KEYWORD
nonn,easy,base
AUTHOR
Paolo P. Lava, Apr 11 2016
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 15 04:39 EDT 2024. Contains 375931 sequences. (Running on oeis4.)