A381135 Numbers of the form d_1 d_2 d_3 ... where the sum of their digits multiplied by their digit positions is equal to their number of digits.
1, 20, 110, 300, 1010, 2100, 4000, 10010, 12000, 20100, 31000, 50000, 100010, 111000, 200100, 220000, 301000, 410000, 600000, 1000010, 1020000, 1101000, 1300000, 2000100, 2110000, 3001000, 3200000, 4010000, 5100000, 7000000, 10000010, 10110000, 11001000, 12100000
Offset: 1
Examples
301000 is a member of this sequence because it has 3*1 + 1*3 = 6 digits.
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000
- Michael S. Branicky, Python program for OEIS A381135
Programs
-
PARI
isok(k) = my(d=digits(k)); sum(i=1, #d, i*d[i]) == #d; \\ Michel Marcus, Feb 17 2025
-
Python
def ok(n): return sum(int(d)*(i+1) for i, d in enumerate(str(n))) == len(str(n))
-
Python
# see linked program for a different algorithm from itertools import count, islice from sympy.utilities.iterables import partitions def agen(): # generator of terms for d in count(1): yield from sorted(int("".join(str(p[k]) if k in p else "0" for k in range(1, d+1))) for p in partitions(d, m=d, k=d) if max(p.values()) < 10 if 1 in p and p[1] != 0) print(list(islice(agen(), 34))) # Michael S. Branicky, Feb 19 2025
Extensions
More terms from Michel Marcus, Feb 17 2025
Comments