login
A062340
Primes whose sum of digits is a multiple of 5.
3
5, 19, 23, 37, 41, 73, 109, 113, 127, 131, 163, 181, 271, 307, 311, 389, 401, 433, 479, 523, 541, 569, 587, 613, 631, 659, 677, 811, 839, 857, 929, 947, 983, 997, 1009, 1013, 1031, 1063, 1103, 1117, 1153, 1171, 1289, 1301, 1423, 1487, 1531, 1559, 1621, 1667
OFFSET
1,1
LINKS
FORMULA
Intersection of A000040 (primes) and A227793 (sum of digits in 5Z). - M. F. Hasler, Mar 10 2022
EXAMPLE
569 is a prime with sum of digits = 20, hence belongs to the sequence.
MATHEMATICA
Select[Prime[Range[300]], Divisible[Total[IntegerDigits[#]], 5]&] (* Harvey P. Dale, Jul 06 2020 *)
PROG
(Magma) [ p: p in PrimesUpTo(10000) | &+Intseq(p) mod 5 eq 0 ]; // Vincenzo Librandi, Apr 02 2011
(Python)
from sympy import primerange as primes
def ok(p): return sum(map(int, str(p)))%5 == 0
print(list(filter(ok, primes(1, 1668)))) # Michael S. Branicky, May 19 2021
(PARI) select( {is_A062340(n)=sumdigits(n)%5==0&&isprime(n)}, primes([1, 2000])) \\ M. F. Hasler, Mar 10 2022
CROSSREFS
Cf. A007953 (sum of digits), A227793 (sum of digits divisible by 5).
Has as subsequence A062341 (primes with sum of digits s = 5), A107579 (s = 10), A106760 (s = 20), A106763 (s = 25), A106770 (s = 35), A106773 (s = 40), A106780 (s = 50), A106783 (s = 55), A107619 (s = 65) and A181321 (s = 70).
Cf. A062340 (equivalent for 8).
Sequence in context: A191609 A191084 A146509 * A167766 A106957 A236167
KEYWORD
nonn,base,easy
AUTHOR
Amarnath Murthy, Jun 21 2001
EXTENSIONS
Corrected and extended by Harvey P. Dale and Larry Reeves (larryr(AT)acm.org), Jul 04 2001
STATUS
approved