A276037 Numbers using only digits 1 and 5.
1, 5, 11, 15, 51, 55, 111, 115, 151, 155, 511, 515, 551, 555, 1111, 1115, 1151, 1155, 1511, 1515, 1551, 1555, 5111, 5115, 5151, 5155, 5511, 5515, 5551, 5555, 11111, 11115, 11151, 11155, 11511, 11515, 11551, 11555, 15111, 15115, 15151, 15155, 15511, 15515
Offset: 1
Examples
5551 is in the sequence because all of its digits are 1 or 5 and consequently because the product of digits, 5*5*5*1 = 125 = 5^3 is a power of 5.
Links
- Chai Wah Wu, Table of n, a(n) for n = 1..8190
Crossrefs
Programs
-
Magma
[n: n in [1..20000] | Set(Intseq(n)) subset {1, 5}]; // Vincenzo Librandi, Aug 19 2016
-
Maple
S[0]:= [0]: for d from 1 to 6 do S[d]:= map(t -> (10*t+1, 10*t+5), S[d-1]) od: seq(op(S[d]),d=1..6); # Robert Israel, Aug 22 2016
-
Mathematica
Select[Range[20000], IntegerQ[Log[5, Times@@(IntegerDigits[#])]]&]
-
PARI
a(n) = my(v=[1,5], b=binary(n+1), d=vector(#b-1,i, v[b[i+1]+1])); sum(i=1, #d, d[i] * 10^(#d-i)) \\ David A. Corneth, Aug 22 2016
-
Python
from itertools import product A276037_list = [int(''.join(d)) for l in range(1,10) for d in product('15',repeat=l)] # Chai Wah Wu, Aug 18 2016
-
Python
def A276037(n): return (int(bin(n+1)[3:])<<2)+(10**((n+1).bit_length()-1)-1)//9 # Chai Wah Wu, Jun 28 2025
Formula
From Robert Israel, Aug 22 2016: (Start)
a(2n+1) = 10 a(n) + 1.
a(2n+2) = 10 a(n) + 5.
G.f. g(x) satisfies g(x) = 10 (x + x^2) g(x^2) + (x + 5 x^2)/(1 - x^2). (End)
Extensions
Example changed by David A. Corneth, Aug 22 2016
Comments