login
Primes which can be expressed as sum of distinct powers of 5.
9

%I #10 May 31 2021 09:34:37

%S 5,31,131,151,631,751,3251,3881,16381,19381,19501,19531,78781,78901,

%T 81281,81401,81901,82031,93901,94531,97001,97501,97651,390751,390781,

%U 393901,394501,406381,468781,469501,471901,472631,484531,485131,487651,1953151,1953901

%N Primes which can be expressed as sum of distinct powers of 5.

%C Primes whose base 5 representation contains only zeros and 1's.

%H Michael S. Branicky, <a href="/A077719/b077719.txt">Table of n, a(n) for n = 1..10000</a>

%o (Python)

%o from sympy import isprime

%o def aupton(terms):

%o k, alst = 0, []

%o while len(alst) < terms:

%o k += 1

%o t = sum(5**i*int(di) for i, di in enumerate((bin(k)[2:])[::-1]))

%o if isprime(t): alst.append(t)

%o return alst

%o print(aupton(37)) # _Michael S. Branicky_, May 31 2021

%Y Cf. A020449, A000695, A033042, A077717, A077718, A077720, A077721, A077722.

%K nonn

%O 1,1

%A _Amarnath Murthy_, Nov 19 2002

%E More terms from _Sascha Kurz_, Jan 03 2003

%E a(36) and beyond from _Michael S. Branicky_, May 31 2021